Skip to content

Commit 481d4c7

Browse files
authored
Merge pull request #135 from cbusillo/feat/update-check
Add guarded release update check
2 parents 6681573 + 8a989d6 commit 481d4c7

4 files changed

Lines changed: 544 additions & 0 deletions

File tree

code-rs/Cargo.lock

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

code-rs/cli/Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ which = { workspace = true }
4848
owo-colors = { workspace = true }
4949
serde_json = { workspace = true }
5050
serde = { workspace = true, features = ["derive"] }
51+
sha2 = { workspace = true }
5152
supports-color = { workspace = true }
5253
tokio = { workspace = true, features = [
5354
"io-std",

code-rs/cli/src/main.rs

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,9 @@ use code_cli::login::run_login_with_device_code;
1717
use code_cli::login::run_logout;
1818
mod bridge;
1919
mod llm;
20+
mod update;
2021
use llm::{LlmCli, run_llm};
22+
use update::{UpdateCheckCommand, UpdateCommand, run_update, run_update_check};
2123
use code_common::CliConfigOverrides;
2224
use code_core::{entry_to_rollout_path, SessionCatalog, SessionQuery};
2325
use code_core::spawn::spawn_std_command_with_retry;
@@ -156,6 +158,13 @@ enum Subcommand {
156158
/// Download and run preview artifact by slug.
157159
Preview(PreviewArgs),
158160

161+
/// Check the GitHub Release update manifest for a newer build.
162+
#[clap(name = "update-check")]
163+
UpdateCheck(UpdateCheckCommand),
164+
165+
/// Update a directly managed dogfood binary after checksum verification.
166+
Update(UpdateCommand),
167+
159168
/// Side-channel LLM utilities (no TUI events).
160169
Llm(LlmCli),
161170

@@ -619,6 +628,12 @@ async fn cli_main(code_linux_sandbox_exe: Option<PathBuf>) -> anyhow::Result<()>
619628
Some(Subcommand::Preview(args)) => {
620629
preview_main(args).await?;
621630
}
631+
Some(Subcommand::UpdateCheck(args)) => {
632+
run_update_check(args).await?;
633+
}
634+
Some(Subcommand::Update(args)) => {
635+
run_update(args).await?;
636+
}
622637
Some(Subcommand::Bridge(bridge_cli)) => {
623638
run_bridge_command(bridge_cli).await?;
624639
}

0 commit comments

Comments
 (0)