Skip to content

Commit 62c54dc

Browse files
Fixing cfg! macro so that workflow plays nice.
1 parent 4fa729e commit 62c54dc

File tree

1 file changed

+15
-11
lines changed

1 file changed

+15
-11
lines changed

src/main.rs

Lines changed: 15 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ pub mod key;
22

33
use clap::Parser;
44
use colored::{ColoredString, Colorize};
5+
use copypasta::ClipboardProvider;
56
use core::fmt;
67
use key::generate_key;
78
use std::path::PathBuf;
@@ -193,16 +194,19 @@ impl Args {
193194
}
194195

195196
fn main() {
196-
let mut args = Args::parse();
197-
198-
#[cfg(windows)]
199-
match ansi_term::enable_ansi_support() {
200-
Ok(_) => {}
201-
Err(_) => {
202-
println!("[WARN] Colors will be disabled, is this what you wanted?");
203-
args.disable_color = true;
204-
}
205-
};
197+
if cfg!(windows){
198+
let mut args = Args::parse();
206199

207-
args.generate_key();
200+
201+
match ansi_term::enable_ansi_support() {
202+
Ok(_) => {}
203+
Err(_) => {
204+
println!("[WARN] Colors will be disabled, is this what you wanted?");
205+
args.disable_color = true;
206+
}
207+
};
208+
args.generate_key();
209+
} else {
210+
Args::parse().generate_key();
211+
}
208212
}

0 commit comments

Comments
 (0)