Skip to content

Commit 2e50593

Browse files
committed
fix: set params from the desktop ui
1 parent e2b5cfd commit 2e50593

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

desktop/src-tauri/src/command_runner.rs

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -181,20 +181,21 @@ impl CommandRunner {
181181
args: &[&str],
182182
params: Option<std::collections::HashMap<String, String>>,
183183
) -> CommandResult<()> {
184-
let mut cmd_args = vec![verb, executable_id];
185-
cmd_args.extend(args);
184+
let mut cmd_args = vec![verb.to_string(), executable_id.to_string()];
185+
cmd_args.extend(args.iter().map(|&s| s.to_string()));
186186

187187
let mut cmd =
188188
TokioCommand::new("/Users/jahvon/workspaces/github.com/jahvon/flow/.bin/flow");
189-
cmd.args(&cmd_args);
190-
cmd.stdout(Stdio::piped()).stderr(Stdio::piped());
191189

192-
// TODO: ensure that the CLI supports this
193190
if let Some(params) = params {
194191
for (key, value) in params {
195-
cmd.env(key, value);
192+
cmd_args.push("--param".to_string());
193+
let param_arg = format!("{}={}", key, value);
194+
cmd_args.push(param_arg);
196195
}
197196
}
197+
cmd.args(&cmd_args);
198+
cmd.stdout(Stdio::piped()).stderr(Stdio::piped());
198199

199200
println!("streaming cmd: {:?}", cmd);
200201

0 commit comments

Comments
 (0)