fix(app): allow launcher setup without an open project

Keep the Windows plugin test fixture complete so its CI can validate the launcher.
Цей коміт міститься в:
l0ng-ai committed 2026-11-07 22:47:15 +08:00
1 джерело 5890e8abc5
коміт 20acda0f31
4 files changed
+12 -5

No files matched your search

+7 -5
Переглянути файл
@@ -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));
}
}
+2
Переглянути файл
@@ -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"
+2
Переглянути файл
@@ -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",
+1
Переглянути файл
@@ -1640,6 +1640,7 @@ mod tests {
preferred: false,
edits: vec![(path.into(), Vec::new())],
operations: Vec::new(),
file_action: None,
open: None,
data: None,
};