2 Commits

Author SHA1 Message Date
8a10b99eeb fix non-windows build 2022-04-08 21:22:34 +02:00
6c064a1dd8 enable ansi terminal on windows 10 cmd 2022-04-08 21:11:51 +02:00
3 changed files with 7 additions and 1 deletions

1
Cargo.lock generated
View File

@@ -2332,6 +2332,7 @@ checksum = "09cc8ee72d2a9becf2f2febe0205bbed8fc6615b7cb429ad062dc7b7ddd036a9"
name = "uw8"
version = "0.1.2"
dependencies = [
"ansi_term",
"anyhow",
"curlywas",
"minifb",

View File

@@ -24,3 +24,4 @@ warp = { version = "0.3.2", optional = true }
tokio = { version = "1.17.0", features = ["sync", "rt"], optional = true }
tokio-stream = { version = "0.1.8", features = ["sync"], optional = true }
webbrowser = { version = "0.6.0", optional = true }
ansi_term = "0.12.1"

View File

@@ -15,6 +15,10 @@ use uw8::Runtime;
fn main() -> Result<()> {
let mut args = Arguments::from_env();
// try to enable ansi support in win10 cmd shell
#[cfg(target_os="windows")]
let _ = ansi_term::enable_ansi_support();
match args.subcommand()?.as_deref() {
Some("version") => {
println!("{}", env!("CARGO_PKG_VERSION"));