дзеркало
https://github.com/l0ng-ai/openidea.git
синхронізовано 2026-11-08 19:02:17 +02:00
fix(app): allow launcher setup without an open project
Keep the Windows plugin test fixture complete so its CI can validate the launcher.
Цей коміт міститься в:
1 джерело
5890e8abc5
коміт
20acda0f31
4 files changed
+12
-5
No files matched your search
@@ -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));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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"
|
||||
|
||||
@@ -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",
|
||||
|
||||
@@ -1640,6 +1640,7 @@ mod tests {
|
||||
preferred: false,
|
||||
edits: vec![(path.into(), Vec::new())],
|
||||
operations: Vec::new(),
|
||||
file_action: None,
|
||||
open: None,
|
||||
data: None,
|
||||
};
|
||||
|
||||
Reference in new issue
Заблокувати користувача