Skip to content

Commit

Permalink
fix(cli): Make checking latest version an optional feature (#278)
Browse files Browse the repository at this point in the history
fix: Make checking latest version optional feature
  • Loading branch information
nahsi authored Feb 10, 2023
1 parent b05c39b commit da31cbb
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 2 deletions.
5 changes: 4 additions & 1 deletion tools/cli/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,12 @@ toml = "0.5.9"
atty = "0.2.14"
thiserror = "1.0.37"
anyhow = "1.0.66"
check-latest = "1.0.1"
check-latest = { version = "1.0.1", optional = true }
clap = "2.34.0"
exitfailure = "0.5.1"
serde = "1.0.147"
serde_json = "1.0.89"
termion = "1.5.6"

[features]
check-latest = ["dep:check-latest"]
1 change: 1 addition & 0 deletions tools/cli/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ pub fn main() -> Result<(), anyhow::Error> {
return Ok(());
}

#[cfg(feature = "check-latest")]
if let Ok(Some(new_version)) = check_latest::check_max!() {
use termion::color;

Expand Down
5 changes: 4 additions & 1 deletion tools/repl/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,14 @@ serde_json = "1.0.89"
wasmer-wasi = { package = "wasmer-wasi-fl", version = "0.17.1"}

env_logger = "0.9.3"
check-latest = "1.0.1"
check-latest = { version = "1.0.1", optional = true }
log = "0.4.17"
rustyline = { version = "10.0.0", features = ["with-fuzzy"] }
rustyline-derive = "0.7.0"
rustop = "1.1.2"
itertools = "0.10.5"
uuid = { version = "1.2.2", features = ["v4"] }
termion = "1.5.6"

[features]
check-latest = ["dep:check-latest"]
1 change: 1 addition & 0 deletions tools/repl/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,7 @@ fn print_welcome_message() {
color::Fg(color::Reset),
);

#[cfg(feature = "check-latest")]
if let Ok(Some(new_version)) = check_latest::check_max!() {
println!(
"New version is available! {}{} -> {}{}",
Expand Down

0 comments on commit da31cbb

Please sign in to comment.