Run `openshell ` using the system's configured gateway.
(args: &[&str])
| 25 | |
| 26 | /// Run `openshell <args>` using the system's configured gateway. |
| 27 | async fn run_cli(args: &[&str]) -> (String, i32) { |
| 28 | let mut cmd = openshell_cmd(); |
| 29 | cmd.args(args) |
| 30 | .stdout(Stdio::piped()) |
| 31 | .stderr(Stdio::piped()); |
| 32 | |
| 33 | let output = cmd.output().await.expect("spawn openshell"); |
| 34 | let stdout = String::from_utf8_lossy(&output.stdout).to_string(); |
| 35 | let stderr = String::from_utf8_lossy(&output.stderr).to_string(); |
| 36 | let combined = format!("{stdout}{stderr}"); |
| 37 | let code = output.status.code().unwrap_or(-1); |
| 38 | (combined, code) |
| 39 | } |
| 40 | |
| 41 | /// Run `openshell <args>` with a custom config directory so the CLI reads |
| 42 | /// our seeded gateway metadata and edge token instead of the real config. |
no test coverage detected