Skip to content
Open
Show file tree
Hide file tree
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
11 changes: 6 additions & 5 deletions ampup/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,11 @@ name = "ampup"
[dependencies]
anyhow = "1.0.80"
clap = { version = "4.5.2", features = ["derive", "env"] }
console = "0.16"
dialoguer = "0.12"
fs-err = "3.0.0"
futures = "0.3"
indicatif = "0.18"
reqwest = { version = "0.13", default-features = false, features = [
"json",
"query",
Expand All @@ -26,13 +29,11 @@ serde = { version = "1.0", features = ["derive"] }
tempfile = "3.13.0"
tokio = { version = "1.36.0", features = [
"macros",
"test-util",
"rt-multi-thread",
"parking_lot",
"rt-multi-thread",
"sync",
"test-util",
] }
indicatif = "0.18"
console = "0.16"
dialoguer = "0.12"

[build-dependencies]
vergen-gitcl = { version = "9.0.0", features = ["build"] }
7 changes: 4 additions & 3 deletions ampup/src/commands/install.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ use anyhow::Result;

use crate::{
config::Config,
download_manager::DownloadManager,
github::GitHubClient,
install::Installer,
platform::{Architecture, Platform},
Expand All @@ -19,8 +20,7 @@ pub async fn run(
jobs: Option<usize>,
) -> Result<()> {
let config = Config::new(install_dir)?;
// Will be passed to DownloadManager for bounded-concurrent downloads
let _max_concurrent = jobs.unwrap_or(4);
let max_concurrent = jobs.unwrap_or(4);

// Resolve token with fallback chain: explicit → gh auth token → unauthenticated
let resolved_token = token::resolve_github_token(github_token);
Expand Down Expand Up @@ -89,7 +89,8 @@ pub async fn run(
ui::detail!("Platform: {}, Architecture: {}", platform, arch);

// Install the binary
let installer = Installer::new(version_manager, github);
let download_manager = DownloadManager::new(github, max_concurrent);
let installer = Installer::new(version_manager, download_manager);
installer
.install_from_release(&version, platform, arch)
.await?;
Expand Down
5 changes: 3 additions & 2 deletions ampup/src/commands/update.rs
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
use anyhow::{Context, Result};
use semver::Version;

use crate::{github::GitHubClient, ui, updater::Updater};
use crate::{github::GitHubClient, token, ui, updater::Updater};

pub async fn run(repo: String, github_token: Option<String>) -> Result<()> {
ui::info!("Checking for updates");

let github = GitHubClient::new(repo, github_token)?;
let resolved_token = token::resolve_github_token(github_token);
let github = GitHubClient::new(repo, resolved_token)?;
let updater = Updater::new(github);

let current_version = updater.get_current_version();
Expand Down
Loading