We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 7954d02 commit 85dbd43Copy full SHA for 85dbd43
1 file changed
src/cortex-cli/src/dag_cmd/executor.rs
@@ -8,6 +8,14 @@ use crate::styled_output::print_info;
8
9
use super::types::TaskExecutionResult;
10
11
+fn shell_invocation() -> (&'static str, &'static str) {
12
+ if cfg!(windows) {
13
+ ("cmd.exe", "/C")
14
+ } else {
15
+ ("sh", "-c")
16
+ }
17
+}
18
+
19
/// Task executor that runs the actual task commands.
20
pub struct TaskExecutor {
21
timeout: Duration,
@@ -76,8 +84,9 @@ impl TaskExecutor {
76
84
let timeout_duration = self.timeout;
77
85
78
86
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)
81
90
.arg(cmd)
82
91
.output()
83
92
.await
0 commit comments