Skip to content

Commit

Permalink
Move version prints to stderr
Browse files Browse the repository at this point in the history
This way they don't get in the way of pipes and other commands
  • Loading branch information
NikolaBorisov committed Sep 14, 2023
1 parent e938d34 commit 1388734
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1245,7 +1245,7 @@ fn main_version_check(dev: bool, force: bool) -> Result<()> {
|| force
|| crnt_version_data.as_ref().unwrap().last_check < latest_acceptable
{
println!("checking version with server...");
// println!("checking version with server...");
check_version_with_server(dev)?
} else {
crnt_version_data.unwrap()
Expand All @@ -1255,7 +1255,8 @@ fn main_version_check(dev: bool, force: bool) -> Result<()> {
}

fn prompt_update(reason: &str, latest: &str) {
println!(
// print to stderr
eprintln!(
"Your version {} is {}. Please update to the latest version {}.",
VERSION, reason, latest
);
Expand All @@ -1269,7 +1270,7 @@ fn prompt_update(reason: &str, latest: &str) {
sudo_str = "";
}
}
println!(
eprintln!(
"Update to the latest version using `{}deepctl version update`",
sudo_str
);
Expand Down

0 comments on commit 1388734

Please sign in to comment.