Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(dre): self update on non linux machines #585

Merged
merged 1 commit into from
Jul 8, 2024
Merged
Changes from all commits
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
6 changes: 6 additions & 0 deletions rs/cli/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ use regex::Regex;
use registry_canister::mutations::do_change_subnet_membership::ChangeSubnetMembershipPayload;
use serde_json::Value;
use std::collections::BTreeMap;
use std::env;
use std::str::FromStr;

const STAGING_NEURON_ID: u64 = 49;
Expand Down Expand Up @@ -682,6 +683,11 @@ fn check_latest_release(curr_version: &str, proceed_with_upgrade: bool) -> anyho
return Ok(UpdateStatus::NewVersion(latest_release.version.clone()));
}

// Complete list can be found: https://doc.rust-lang.org/std/env/consts/constant.OS.html
if env::consts::OS != "linux" {
return Err(anyhow::anyhow!("Only linux is supported for automatic updates"));
}

info!("Binary not up to date. Updating to {}", latest_release.version);

let asset = match latest_release.asset_for("dre", None) {
Expand Down
Loading