From e832ab56f4e6a29551745c2065cc98a5b57ced56 Mon Sep 17 00:00:00 2001 From: slideglide <68702247+slideglide@users.noreply.github.com> Date: Sun, 22 Feb 2026 03:14:59 +0300 Subject: [PATCH 1/4] auto install binaries --- src/sdk.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/sdk.rs b/src/sdk.rs index eabd25f..42ab992 100644 --- a/src/sdk.rs +++ b/src/sdk.rs @@ -393,10 +393,11 @@ fn install(config: &mut Config, path: PathBuf, force: bool) { fetch_repo_info(&repo); switch_to_tag(config, &repo); + install_binaries(config, None, None); done!("Successfully installed SDK"); info!("Please restart your command line to have the GEODE_SDK enviroment variable set."); - info!("Use `geode sdk install-binaries` to install pre-built binaries"); + info!("Pre-built binaries have been automatically installed. However, if you would like to install them yourself in the future, you can run `geode sdk install-binaries`."); } fn fetch_repo_info(repo: &git2::Repository) -> git2::MergeAnalysis { From 9d9c7ea3b73275a2e13ccfad86d0a681e105b2b4 Mon Sep 17 00:00:00 2001 From: slideglide <68702247+slideglide@users.noreply.github.com> Date: Sun, 22 Feb 2026 03:26:45 +0300 Subject: [PATCH 2/4] make it install binaries in update too! --- src/sdk.rs | 125 +++++++++++++++++++++++++++-------------------------- 1 file changed, 64 insertions(+), 61 deletions(-) diff --git a/src/sdk.rs b/src/sdk.rs index 42ab992..870ecba 100644 --- a/src/sdk.rs +++ b/src/sdk.rs @@ -442,67 +442,70 @@ fn fetch_repo_info(repo: &git2::Repository) -> git2::MergeAnalysis { } fn update(config: &mut Config, branch: Option) { - // Switch branch if necessary - match branch.as_deref().unwrap_or(if config.sdk_nightly { - "nightly" - } else { - "stable" - }) { - "nightly" => { - info!("Switching to nightly"); - config.sdk_nightly = true; - config.sdk_version = None; - } - "stable" => { - info!("Switching to stable"); - config.sdk_nightly = false; - config.sdk_version = None; - } - ver => { - info!("Switching to {}", ver); - config.sdk_nightly = false; - config.sdk_version = Some(ver.into()); - } - }; - - info!("Updating SDK"); - - // Initialize repository - let repo = Repository::open(Config::sdk_path()) - .nice_unwrap("Could not initialize local SDK repository"); - - // Fetch - let merge_analysis = fetch_repo_info(&repo); - - if merge_analysis.is_up_to_date() { - switch_to_tag(config, &repo); - - done!("SDK is up to date"); - } else if merge_analysis.is_fast_forward() { - // Change head and checkout - - switch_to_tag(config, &repo); - - done!("Successfully updated SDK."); - } else { - let mut opts = StatusOptions::new(); - opts.renames_head_to_index(true) - .include_untracked(true) - .recurse_untracked_dirs(true); - - let statuses = repo.statuses(Some(&mut opts)); - if statuses.is_ok_and(|x| !x.is_empty()) { - fail!("Cannot update SDK, it has local changes"); - info!( - "Go into the repository at {} and manually run `git pull`", - Config::sdk_path().to_str().unwrap() - ); - } else { - switch_to_tag(config, &repo); - - done!("Successfully updated SDK."); - } - } + // Switch branch if necessary + match branch.as_deref().unwrap_or(if config.sdk_nightly { + "nightly" + } else { + "stable" + }) { + "nightly" => { + info!("Switching to nightly"); + config.sdk_nightly = true; + config.sdk_version = None; + } + "stable" => { + info!("Switching to stable"); + config.sdk_nightly = false; + config.sdk_version = None; + } + ver => { + info!("Switching to {}", ver); + config.sdk_nightly = false; + config.sdk_version = Some(ver.into()); + } + }; + + info!("Updating SDK"); + + // Initialize repository + let repo = Repository::open(Config::sdk_path()) + .nice_unwrap("Could not initialize local SDK repository"); + + // Fetch + let merge_analysis = fetch_repo_info(&repo); + + if merge_analysis.is_up_to_date() { + switch_to_tag(config, &repo); + install_binaries(config, None, None); + + done!("SDK is up to date"); + } else if merge_analysis.is_fast_forward() { + // Change head and checkout + + switch_to_tag(config, &repo); + install_binaries(config, None, None); + + done!("Successfully updated SDK."); + } else { + let mut opts = StatusOptions::new(); + opts.renames_head_to_index(true) + .include_untracked(true) + .recurse_untracked_dirs(true); + + let statuses = repo.statuses(Some(&mut opts)); + if statuses.is_ok_and(|x| !x.is_empty()) { + fail!("Cannot update SDK, it has local changes"); + info!( + "Go into the repository at {} and manually run `git pull`", + Config::sdk_path().to_str().unwrap() + ); + } else { + switch_to_tag(config, &repo); + install_binaries(config, None, None); + + done!("Successfully updated SDK."); + } + } } fn switch_to_ref(repo: &Repository, name: &str) { From 3f061d04034490da4812d5cb54990691c521b460 Mon Sep 17 00:00:00 2001 From: slideglide <68702247+slideglide@users.noreply.github.com> Date: Sun, 22 Feb 2026 03:29:12 +0300 Subject: [PATCH 3/4] add info for binaries in update --- src/sdk.rs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/sdk.rs b/src/sdk.rs index 870ecba..b329f5e 100644 --- a/src/sdk.rs +++ b/src/sdk.rs @@ -486,6 +486,7 @@ fn update(config: &mut Config, branch: Option) { install_binaries(config, None, None); done!("Successfully updated SDK."); + info!("Pre-built binaries have been automatically installed as well, but if you wish to install them manually in the future, run `geode sdk install-binaries`.") } else { let mut opts = StatusOptions::new(); opts.renames_head_to_index(true) @@ -504,6 +505,7 @@ fn update(config: &mut Config, branch: Option) { install_binaries(config, None, None); done!("Successfully updated SDK."); + info!("Pre-built binaries have been automatically installed as well, but if you wish to install them manually in the future, run `geode sdk install-binaries`.") } } } From e0b61ccaefb0571d5edd9b6d2491c1369106bbfc Mon Sep 17 00:00:00 2001 From: slideglide <68702247+slideglide@users.noreply.github.com> Date: Sun, 22 Feb 2026 03:34:50 +0300 Subject: [PATCH 4/4] fix indentation ig --- src/sdk.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/sdk.rs b/src/sdk.rs index b329f5e..ccfe8cd 100644 --- a/src/sdk.rs +++ b/src/sdk.rs @@ -393,7 +393,7 @@ fn install(config: &mut Config, path: PathBuf, force: bool) { fetch_repo_info(&repo); switch_to_tag(config, &repo); - install_binaries(config, None, None); + install_binaries(config, None, None); done!("Successfully installed SDK"); info!("Please restart your command line to have the GEODE_SDK enviroment variable set.");