diff --git a/crates/ide-cli/src/install.rs b/crates/ide-cli/src/install.rs index 4cdad7438..0d52ceeb3 100644 --- a/crates/ide-cli/src/install.rs +++ b/crates/ide-cli/src/install.rs @@ -399,17 +399,19 @@ mod wrapper_tests { assert!(compiled.status.success(), "{}", String::from_utf8_lossy(&compiled.stderr)); let path = install_wrapper(&exe, &dir.path().join("bin"), true).unwrap(); let output = std::process::Command::new("cmd.exe") - .args(["/d", "/c"]) - .arg(&path) - .args(["a b", "中文"]) - .raw_arg("\"x&y\"") + .args(["/d", "/s", "/c"]) + .raw_arg(format!("\"\"{}\" \"a b\" \"中文\" \"x&y\"\"", path.display())) .output() .unwrap(); assert_eq!(output.status.code(), Some(7)); assert_eq!(String::from_utf8(output.stdout).unwrap().replace("\r\n", "\n"), "--cli\na b\n中文\nx&y\n"); let check = dir.path().join("check.cmd"); std::fs::write(&check, "@echo off\r\nfor /f \"tokens=2 delims=:\" %%c in ('chcp') do set \"before=%%c\"\r\ncall \"%~dp0bin\\openidea.cmd\" example\r\nset \"code=%errorlevel%\"\r\nfor /f \"tokens=2 delims=:\" %%c in ('chcp') do set \"after=%%c\"\r\nif not \"%before%\"==\"%after%\" exit /b 99\r\nexit /b %code%\r\n").unwrap(); - let output = std::process::Command::new("cmd.exe").args(["/d", "/c"]).arg(check).output().unwrap(); + let output = std::process::Command::new("cmd.exe") + .args(["/d", "/s", "/c"]) + .raw_arg(format!("\"\"{}\"\"", check.display())) + .output() + .unwrap(); assert_eq!(output.status.code(), Some(7)); } } diff --git a/crates/ide-host/src/trust.rs b/crates/ide-host/src/trust.rs index 2144c9d15..3038a6406 100644 --- a/crates/ide-host/src/trust.rs +++ b/crates/ide-host/src/trust.rs @@ -196,6 +196,8 @@ pub fn restricted_command_allowed(cmd: &str) -> bool { cmd, "app_info" | "app_build_info" + | "app_cli_install" + | "app_cli_uninstall" | "app_log_location" | "app_check_update" | "app_startup_update_check" diff --git a/crates/ide-host/tests/trust.rs b/crates/ide-host/tests/trust.rs index 74766decd..889036295 100644 --- a/crates/ide-host/tests/trust.rs +++ b/crates/ide-host/tests/trust.rs @@ -33,6 +33,8 @@ async fn application_commands_work_in_restricted_projects_and_without_a_project( for command in [ "app_info", "app_build_info", + "app_cli_install", + "app_cli_uninstall", "app_log_location", "app_check_update", "app_startup_update_check", diff --git a/crates/ide-plugin/src/runtime.rs b/crates/ide-plugin/src/runtime.rs index ce2a59298..a659985bf 100644 --- a/crates/ide-plugin/src/runtime.rs +++ b/crates/ide-plugin/src/runtime.rs @@ -1640,6 +1640,7 @@ mod tests { preferred: false, edits: vec![(path.into(), Vec::new())], operations: Vec::new(), + file_action: None, open: None, data: None, };