mirror of
https://github.com/crunchy-labs/crunchy-cli.git
synced 2026-01-21 04:02:00 -06:00
Fix windows ok output character
This commit is contained in:
parent
cd9c69baf1
commit
e9b3088cde
1 changed files with 7 additions and 1 deletions
|
|
@ -19,6 +19,12 @@ impl CliProgress {
|
|||
let init_message = format!("{}", record.args());
|
||||
let init_level = record.level();
|
||||
let handler = thread::spawn(move || {
|
||||
#[cfg(not(windows))]
|
||||
let ok = '✔';
|
||||
#[cfg(windows)]
|
||||
// windows does not support all unicode characters by default in their consoles, so
|
||||
// we're using this (square root?) symbol instead. microsoft.
|
||||
let ok = '√';
|
||||
let states = ["-", "\\", "|", "/"];
|
||||
|
||||
let mut old_message = init_message.clone();
|
||||
|
|
@ -68,7 +74,7 @@ impl CliProgress {
|
|||
// clear last line
|
||||
// prefix (2), space (1), state (1), space (1), message(n)
|
||||
let _ = write!(stdout(), "\r {}", " ".repeat(old_message.len()));
|
||||
let _ = writeln!(stdout(), "\r:: ✓ {}", old_message);
|
||||
let _ = writeln!(stdout(), "\r:: {} {}", ok, old_message);
|
||||
let _ = stdout().flush();
|
||||
});
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue