From 162a62fb6f0de4d70ba65044af2c67094ee59488 Mon Sep 17 00:00:00 2001 From: 魏曹先生 <1992414357@qq.com> Date: Sun, 9 Nov 2025 16:22:34 +0800 Subject: fix: Windows support --- Cargo.lock | 24 +++++++++++++++++++++++- src/bin/jvv.rs | 5 +---- 2 files changed, 24 insertions(+), 5 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index d9bb446..fc8b3ce 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1894,7 +1894,7 @@ dependencies = [ "tokio", "uuid", "vcs_docs", - "winapi-util", + "winapi", ] [[package]] @@ -2000,6 +2000,22 @@ dependencies = [ "unicode-ident", ] +[[package]] +name = "winapi" +version = "0.3.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5c839a674fcd7a98952e593242ea400abe93992746761e38641405d28b00f419" +dependencies = [ + "winapi-i686-pc-windows-gnu", + "winapi-x86_64-pc-windows-gnu", +] + +[[package]] +name = "winapi-i686-pc-windows-gnu" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" + [[package]] name = "winapi-util" version = "0.1.11" @@ -2009,6 +2025,12 @@ dependencies = [ "windows-sys 0.61.2", ] +[[package]] +name = "winapi-x86_64-pc-windows-gnu" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" + [[package]] name = "windows-core" version = "0.62.2" diff --git a/src/bin/jvv.rs b/src/bin/jvv.rs index 6c3258a..9f80e0e 100644 --- a/src/bin/jvv.rs +++ b/src/bin/jvv.rs @@ -189,10 +189,7 @@ async fn main() { // Init colored #[cfg(windows)] - if let Err(err) = colored::control::set_virtual_terminal(true) { - eprintln!("{}", t!("jvv.fail.colored_control", err = err.to_string())); - return; - } + let _ = colored::control::set_virtual_terminal(true); let Ok(parser) = JustEnoughVcsVault::try_parse() else { println!("{}", md(t!("jvv.help"))); -- cgit