Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
180 changes: 180 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,8 @@ tar = "0.4"
semver = "1"
sqlformat = "0.5.0"
sysinfo = { version = "0.38.4", default-features = false, features = ["system"] }
self_update = { version = "0.42", default-features = false, features = ["rustls"] }
lzma-rs = "0.3"

[dev-dependencies]
mockito = "1"
Expand Down
3 changes: 3 additions & 0 deletions src/command.rs
Original file line number Diff line number Diff line change
Expand Up @@ -223,6 +223,9 @@ pub enum Commands {
#[arg(value_enum)]
shell: ShellChoice,
},

/// Update the hotdata CLI to the latest release
Update,
}

#[derive(Clone, clap::ValueEnum)]
Expand Down
8 changes: 8 additions & 0 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ mod sandbox_session;
mod skill;
mod table;
mod tables;
mod update;
mod util;
mod workspace;

Expand Down Expand Up @@ -148,6 +149,12 @@ fn main() {
skill::maybe_auto_update_after_cli_upgrade();
}

// Quiet update-available notice. Skip during `hotdata update` itself so
// we don't talk over the updater's own output.
if !matches!(&cli.command, Some(Commands::Update)) {
update::maybe_print_update_notice();
}

match cli.command {
None => {
use clap::CommandFactory;
Expand Down Expand Up @@ -781,6 +788,7 @@ fn main() {
let mut cmd = Cli::command();
generate(shell, &mut cmd, "hotdata", &mut std::io::stdout());
}
Commands::Update => update::run_update(),
},
}
}
Expand Down
Loading
Loading