From 11cc350f9bda31574f8a2ce51e9e1cc697b76be6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=AA=80=E8=BD=B6=E6=AD=A5=E6=A3=8B?= <57583509+oissevalt@users.noreply.github.com> Date: Fri, 8 Dec 2023 01:09:38 +0800 Subject: [PATCH] rollback: Path issue --- src/main.rs | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/main.rs b/src/main.rs index 0dca6ec..f496830 100644 --- a/src/main.rs +++ b/src/main.rs @@ -91,7 +91,7 @@ fn run_command(path: impl AsRef) { ); std::thread::sleep(std::time::Duration::from_secs(2)); - let err = Command::new(path.as_ref().join(SEAL_EXE)) + let err = Command::new(Path::new("./").join(SEAL_EXE)) .current_dir(path) .exec(); eprintln!("\n{}\n", format!("出现错误: {}", err).red()); @@ -116,7 +116,12 @@ fn run_command(path: impl AsRef) { std::thread::sleep(std::time::Duration::from_secs(2)); if let Err(err) = Command::new("cmd") .current_dir(path) - .args(["/C", "start", "", path.as_ref().join(SEAL_EXE)]) + .args([ + "/C", + "start", + "", + &Path::new("./").join(SEAL_EXE).to_string_lossy(), + ]) .spawn() { eprintln!("\n{}\n", format!("出现错误: {}", err).red());