Skip to content

Commit b992680

Browse files
committed
fix(devti): enhance shell command execution and clean up code
- Remove unnecessary comment in ProjectRule - Improve shell command execution in ProcessExecutor by detecting available shells - Use first available shell or default to 'bash' if no shells are detected
1 parent 47a1e49 commit b992680

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

core/src/main/kotlin/cc/unitmesh/devti/sketch/rule/ProjectRule.kt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@ class ProjectRule(private val project: Project) {
2525
return "<user-rule>\n$content\n</user-rule>"
2626
}
2727

28-
/// try .devin file
2928
val devinFile = project.lookupFile("$RULE_PATH/$filename.devin")
3029
if (devinFile != null) {
3130
val content = devinFile.readText()

core/src/main/kotlin/cc/unitmesh/devti/sketch/run/ProcessExecutor.kt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,8 @@ class ProcessExecutor(val project: Project) {
143143
AutoDevNotifications.notify(project, "Failed to get JAVA_HOME: ${e.message}")
144144
}
145145

146-
val commands: List<String> = listOf("bash", "--noprofile", "--norc", "-c", formatCommand(shellScript))
146+
val shell = ShellUtil.detectShells().firstOrNull() ?: "bash"
147+
val commands: List<String> = listOf(shell, "--noprofile", "--norc", "-c", formatCommand(shellScript))
147148

148149
if (basedir != null) {
149150
commandLine.withWorkDirectory(basedir)

0 commit comments

Comments
 (0)