diff --git a/e2e/run_test b/e2e/run_test index 196a122082..9a930311d9 100755 --- a/e2e/run_test +++ b/e2e/run_test @@ -15,6 +15,7 @@ setup_env() { export RTX_DEFAULT_TOOL_VERSIONS_FILENAME=.e2e-tool-versions export RTX_DEFAULT_CONFIG_FILENAME=.e2e.rtx.toml export RTX_CONFIG_FILE="$ROOT/e2e/.config/rtx/config.toml" + export RTX_ALWAYS_KEEP_DOWNLOAD="1" export RTX_TRUSTED_CONFIG_PATHS="$ROOT/e2e" export RTX_YES="1" export NPM_CONFIG_FUND="false" diff --git a/e2e/test_nodejs b/e2e/test_nodejs index e861976aaa..6f5bc00c25 100755 --- a/e2e/test_nodejs +++ b/e2e/test_nodejs @@ -1,23 +1,25 @@ #!/usr/bin/env bash +set -x set -euo pipefail # shellcheck source-path=SCRIPTDIR source "$(dirname "$0")/assert.sh" export RTX_EXPERIMENTAL=1 -export RTX_NODE_BUILD=1 +export RTX_NODE_COREPACK=1 export RTX_NODE_DEFAULT_PACKAGES_FILE="$ROOT/e2e/.default-npm-packages" rtx plugin uninstall node rtx i node node@lts/hydrogen assert_contains "rtx x node@lts/hydrogen -- node --version" "v18." assert "rtx x -- node --version" "v20.0.0" -assert_contains "rtx node node-build --version" "node-build " +assert_contains "rtx x -- which yarn" "yarn" # test asdf-nodejs rtx plugin i nodejs https://github.com/asdf-vm/asdf-nodejs.git rtx use nodejs@20.1.0 rtx ls assert "rtx x -- node --version" "v20.1.0" +assert_contains "rtx ls-remote nodejs" "20.1.0" assert_contains "rtx node nodebuild --version" "node-build " rtx use --rm node @@ -25,19 +27,7 @@ rtx use --rm node RTX_LEGACY_VERSION_FILE=1 assert_contains "rtx current node" "20.0.0" RTX_LEGACY_VERSION_FILE=0 assert_not_contains "rtx current node" "20.0.0" rtx plugin uninstall nodejs +assert_not_contains "rtx plugins --user" "node" # disable nodejs plugin RTX_DISABLE_TOOLS=node assert_not_contains "rtx plugins --core" "node" - -export RTX_NODE_BUILD=0 -rtx uninstall -a node -rtx i node -assert "rtx x -- node --version" "v20.0.0" -# rtx uninstall node -# RTX_NODE_COMPILE=1 rtx i node -# assert "rtx x -- node --version" "v20.0.0" - -export RTX_NODE_COREPACK=1 -rtx uninstall node -rtx i node -assert_contains "rtx x node -- which yarn" "yarn" diff --git a/src/toolset/mod.rs b/src/toolset/mod.rs index c90c5566a2..24ac224d8e 100644 --- a/src/toolset/mod.rs +++ b/src/toolset/mod.rs @@ -93,11 +93,13 @@ impl Toolset { pub fn install_arg_versions(&mut self, config: &Config, opts: &InstallOptions) -> Result<()> { let mpr = MultiProgressReport::new(); let versions = self - .list_missing_versions(config) + .list_current_versions() .into_iter() + .filter(|(p, tv)| opts.force || p.is_version_installed(tv)) + .map(|(_, tv)| tv) .filter(|tv| matches!(self.versions[&tv.plugin_name].source, ToolSource::Argument)) - .cloned() .collect_vec(); + debug!("install_arg_versions: {}", versions.iter().join(", ")); self.install_versions(config, versions, &mpr, opts) }