Skip to content

Commit 85dbd43

Browse files
author
Greyforge Admin
committed
Use platform shell for DAG commands
1 parent 7954d02 commit 85dbd43

1 file changed

Lines changed: 11 additions & 2 deletions

File tree

src/cortex-cli/src/dag_cmd/executor.rs

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,14 @@ use crate::styled_output::print_info;
88

99
use super::types::TaskExecutionResult;
1010

11+
fn shell_invocation() -> (&'static str, &'static str) {
12+
if cfg!(windows) {
13+
("cmd.exe", "/C")
14+
} else {
15+
("sh", "-c")
16+
}
17+
}
18+
1119
/// Task executor that runs the actual task commands.
1220
pub struct TaskExecutor {
1321
timeout: Duration,
@@ -76,8 +84,9 @@ impl TaskExecutor {
7684
let timeout_duration = self.timeout;
7785

7886
let result = tokio::time::timeout(timeout_duration, async {
79-
let output = tokio::process::Command::new("sh")
80-
.arg("-c")
87+
let (shell, shell_arg) = shell_invocation();
88+
let output = tokio::process::Command::new(shell)
89+
.arg(shell_arg)
8190
.arg(cmd)
8291
.output()
8392
.await

0 commit comments

Comments
 (0)