Skip to content
Merged
Show file tree
Hide file tree
Changes from 3 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: 11 additions & 0 deletions src/backend/aqua.rs
Original file line number Diff line number Diff line change
Expand Up @@ -290,6 +290,17 @@ impl Backend for AquaBackend {
(url, v.to_string(), filename, digest)
};

// Determine operation count for progress reporting
let mut op_count = 1; // download
if pkg.checksum.as_ref().is_some_and(|c| c.enabled()) || api_digest.is_some() {
op_count += 1;

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bug: Operation count misses checksum from GitHub API digest

The operation count calculation only checks pkg.checksum.enabled() to determine if checksum verification will occur. However, checksum verification also happens when api_digest is set from the GitHub API (at lines 310-312), which sets platform_info.checksum independently of the package's checksum configuration. When api_digest is present but pkg.checksum.enabled() is false, the op_count will undercount operations, causing the progress bar to overshoot 100% when verify_checksum is called and invokes set_length on the progress report.

Additional Locations (1)

Fix in Cursor Fix in Web

}
let format = pkg.format(&v, os(), arch()).unwrap_or_default();

Copilot AI Dec 17, 2025

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The unwrap_or_default() silently swallows any error from pkg.format(). If this method can return an error that indicates a problem (rather than just a missing format), consider propagating it or logging it for debugging purposes.

Copilot uses AI. Check for mistakes.
if !format.is_empty() && format != "raw" {

Copilot AI Dec 17, 2025

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The string literal "raw" should be extracted as a constant to improve maintainability and prevent typos. Consider defining const RAW_FORMAT: &str = \"raw\"; at the module level.

Copilot uses AI. Check for mistakes.
op_count += 1;
}
Comment thread
cursor[bot] marked this conversation as resolved.
Outdated
ctx.pr.start_operations(op_count);

self.download(ctx, &tv, &url, &filename).await?;

if existing_platform.is_none() {
Expand Down
2 changes: 1 addition & 1 deletion src/cli/doctor/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ use crate::plugins::PluginType;
use crate::plugins::core::CORE_PLUGINS;
use crate::toolset::{ToolVersion, Toolset, ToolsetBuilder};
use crate::ui::{info, style};
use crate::{backend, cmd, dirs, duration, env, file, shims};
use crate::{backend, dirs, duration, env, file, shims};
use console::{Alignment, pad_str, style};
use heck::ToSnakeCase;
use indexmap::IndexMap;
Expand Down
1 change: 0 additions & 1 deletion src/cli/prepare.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
use eyre::Result;

use crate::config::Config;
use crate::miseprintln;
use crate::prepare::{PrepareEngine, PrepareOptions, PrepareStepResult};
use crate::toolset::{InstallOptions, ToolsetBuilder};

Expand Down
2 changes: 1 addition & 1 deletion src/cli/self_update.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ use self_update::{Status, cargo_crate_version};

use crate::cli::version::{ARCH, OS};
use crate::config::Settings;
use crate::{cmd, env};
use crate::env;
use std::collections::BTreeMap;
use std::fs;
#[cfg(target_os = "macos")]
Expand Down
2 changes: 1 addition & 1 deletion src/cli/sync/node.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ use std::path::PathBuf;
use eyre::Result;
use itertools::sorted;

use crate::{backend, cmd, config, dirs, file};
use crate::{backend, config, dirs, file};
use crate::{
config::Config,
env::{NODENV_ROOT, NVM_DIR},
Expand Down
2 changes: 1 addition & 1 deletion src/cli/sync/ruby.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ use eyre::Result;
use itertools::sorted;

use crate::{
backend, cmd,
backend,
config::{self, Config},
dirs, file,
};
Expand Down
2 changes: 1 addition & 1 deletion src/env_diff.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ use serde_derive::{Deserialize, Serialize};
use std::sync::LazyLock as Lazy;

use crate::env::PATH_KEY;
use crate::{cmd, file};
use crate::file;

#[derive(Default, Serialize, Deserialize)]
pub struct EnvDiff {
Expand Down
2 changes: 1 addition & 1 deletion src/file.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ use zip::ZipArchive;
#[cfg(windows)]
use crate::config::Settings;
use crate::ui::progress_report::SingleReport;
use crate::{cmd, dirs, env};
use crate::{dirs, env};

pub fn open<P: AsRef<Path>>(path: P) -> Result<File> {
let path = path.as_ref();
Expand Down
1 change: 0 additions & 1 deletion src/git.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ use gix::{self};
use once_cell::sync::OnceCell;
use xx::file;

use crate::cmd;
use crate::cmd::CmdLineRunner;
use crate::config::Settings;
use crate::file::touch_dir;
Expand Down
2 changes: 1 addition & 1 deletion src/plugins/core/erlang.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ use crate::http::{HTTP, HTTP_FETCH};
use crate::install_context::InstallContext;
use crate::lock_file::LockFile;
use crate::toolset::{ToolRequest, ToolVersion};
use crate::{cmd, file, github, plugins};
use crate::{file, github, plugins};
use async_trait::async_trait;
use eyre::Result;
use xx::regex;
Expand Down
2 changes: 1 addition & 1 deletion src/plugins/core/go.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ use crate::install_context::InstallContext;
use crate::lockfile::PlatformInfo;
use crate::toolset::{ToolRequest, ToolVersion, Toolset};
use crate::ui::progress_report::SingleReport;
use crate::{cmd, env, file, github, plugins};
use crate::{env, file, github, plugins};
use async_trait::async_trait;
use itertools::Itertools;
use tempfile::tempdir_in;
Expand Down
2 changes: 1 addition & 1 deletion src/plugins/core/python.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ use crate::install_context::InstallContext;
use crate::toolset::{ToolRequest, ToolVersion, Toolset};
use crate::ui::progress_report::SingleReport;
use crate::{Result, lock_file::LockFile};
use crate::{cmd, dirs, file, plugins, sysconfig};
use crate::{dirs, file, plugins, sysconfig};
use async_trait::async_trait;
use eyre::{bail, eyre};
use flate2::read::GzDecoder;
Expand Down
2 changes: 1 addition & 1 deletion src/plugins/core/ruby.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ use crate::lockfile::PlatformInfo;
use crate::plugins::PluginSource;
use crate::toolset::{ToolRequest, ToolVersion, Toolset};
use crate::ui::progress_report::SingleReport;
use crate::{cmd, file, plugins, timeout};
use crate::{file, plugins, timeout};
use async_trait::async_trait;
use eyre::{Result, WrapErr};
use itertools::Itertools;
Expand Down
1 change: 0 additions & 1 deletion src/ui/multi_progress_report.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ use indicatif::{MultiProgress, ProgressBar};

use crate::cli::version::VERSION_PLAIN;
use crate::config::Settings;
use crate::progress_trace;
use crate::ui::osc::{self, ProgressState};
use crate::ui::progress_report::{ProgressReport, QuietReport, SingleReport, VerboseReport};
use crate::ui::style;
Expand Down
1 change: 0 additions & 1 deletion src/ui/progress_report.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ use std::{
use indicatif::{ProgressBar, ProgressStyle};
use std::sync::LazyLock as Lazy;

use crate::progress_trace;
use crate::ui::style;
use crate::{backend, env, ui};

Expand Down
Loading