Skip to content

Commit

Permalink
Merge pull request #587 from AleoHQ/update/cleanup
Browse files Browse the repository at this point in the history
Removes leo-version from CLI
  • Loading branch information
collinc97 authored Jan 30, 2021
2 parents 66c736b + 263f52c commit 2849a27
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 7 deletions.
2 changes: 1 addition & 1 deletion leo/commands/update.rs
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ impl CLI for UpdateCommand {
Ok(status) => {
if !quiet {
if status.uptodate() {
tracing::info!("Leo is already on the latest version {}", status.version());
tracing::info!("Leo is already on the latest version");
} else if status.updated() {
tracing::info!("Leo has successfully updated to version {}", status.version());
}
Expand Down
1 change: 0 additions & 1 deletion leo/leo-version

This file was deleted.

2 changes: 1 addition & 1 deletion leo/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ use clap::{App, AppSettings, Arg};
#[cfg_attr(tarpaulin, skip)]
fn main() -> Result<(), CLIError> {
let app = App::new("leo")
.version(include_str!("./leo-version"))
.version(env!("CARGO_PKG_VERSION"))
.about("Leo compiler and package manager")
.author("The Aleo Team <hello@aleo.org>")
.settings(&[
Expand Down
12 changes: 8 additions & 4 deletions leo/updater.rs
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,14 @@ impl Updater {
.build()?
.fetch()?;

tracing::info!("List of available Leo's versions");
let mut output = "\nList of available versions\n".to_string();
for release in releases {
tracing::info!("* {}", release.version);
output += &format!(" * {}\n", release.version);
}

// Forgo using tracing to list the available versions without a log status.
println!("{}", output);

Ok(())
}

Expand All @@ -47,7 +51,7 @@ impl Updater {
.repo_owner(Self::LEO_REPO_OWNER)
.repo_name(Self::LEO_REPO_NAME)
.bin_name(Self::LEO_BIN_NAME)
.current_version(&include_str!("./leo-version").replace('v', ""))
.current_version(&env!("CARGO_PKG_VERSION"))
.show_download_progress(show_output)
.no_confirm(true)
.show_output(show_output)
Expand All @@ -63,7 +67,7 @@ impl Updater {
.repo_owner(Self::LEO_REPO_OWNER)
.repo_name(Self::LEO_REPO_NAME)
.bin_name(Self::LEO_BIN_NAME)
.current_version(&include_str!("./leo-version").replace('v', ""))
.current_version(&env!("CARGO_PKG_VERSION"))
.build()?;

let current_version = updater.current_version();
Expand Down

0 comments on commit 2849a27

Please sign in to comment.