Print ok-ish stuff to stdout
This commit is contained in:
@@ -303,7 +303,6 @@ def test_repos_sync_root_is_file(configtype):
|
|||||||
|
|
||||||
cmd = grm(["repos", "sync", "config", "--config", config.name])
|
cmd = grm(["repos", "sync", "config", "--config", config.name])
|
||||||
assert cmd.returncode != 0
|
assert cmd.returncode != 0
|
||||||
assert len(cmd.stdout) == 0
|
|
||||||
assert "not a directory" in cmd.stderr.lower()
|
assert "not a directory" in cmd.stderr.lower()
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -20,12 +20,12 @@ pub fn print_repo_action(repo: &str, message: &str) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
pub fn print_action(message: &str) {
|
pub fn print_action(message: &str) {
|
||||||
let stderr = Term::stderr();
|
let stdout = Term::stdout();
|
||||||
let mut style = Style::new().yellow();
|
let mut style = Style::new().yellow();
|
||||||
if stderr.is_term() {
|
if stdout.is_term() {
|
||||||
style = style.force_styling(true);
|
style = style.force_styling(true);
|
||||||
}
|
}
|
||||||
stderr
|
stdout
|
||||||
.write_line(&format!("[{}] {}", style.apply_to('\u{2699}'), &message))
|
.write_line(&format!("[{}] {}", style.apply_to('\u{2699}'), &message))
|
||||||
.unwrap();
|
.unwrap();
|
||||||
}
|
}
|
||||||
@@ -46,13 +46,13 @@ pub fn print_repo_success(repo: &str, message: &str) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
pub fn print_success(message: &str) {
|
pub fn print_success(message: &str) {
|
||||||
let stderr = Term::stderr();
|
let stdout = Term::stdout();
|
||||||
let mut style = Style::new().green();
|
let mut style = Style::new().green();
|
||||||
if stderr.is_term() {
|
if stdout.is_term() {
|
||||||
style = style.force_styling(true);
|
style = style.force_styling(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
stderr
|
stdout
|
||||||
.write_line(&format!("[{}] {}", style.apply_to('\u{2714}'), &message))
|
.write_line(&format!("[{}] {}", style.apply_to('\u{2714}'), &message))
|
||||||
.unwrap();
|
.unwrap();
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user