From 1ac8eec5f387ec7a6bce50827f7a0ed0d75b609f Mon Sep 17 00:00:00 2001 From: trivernis Date: Tue, 24 Jan 2023 20:14:06 +0100 Subject: [PATCH] Rename refresh to remap-binaries --- src/args.rs | 8 +++++--- src/main.rs | 2 +- src/nenv.rs | 3 +-- 3 files changed, 7 insertions(+), 6 deletions(-) diff --git a/src/args.rs b/src/args.rs index 687c23a..b4cec68 100644 --- a/src/args.rs +++ b/src/args.rs @@ -28,10 +28,12 @@ pub enum Command { #[command()] Default(DefaultArgs), - /// Refreshes the node environment mappings and cache. - /// This will erase all binary mappings not relevant to the current node version. + /// Creates wrapper scripts for node binaries + /// so they can be found in the path and are executed + /// with the correct node version. This will delete + /// all binary wrappers that don't apply to the active node version. #[command()] - Refresh, + RemapBinaries, /// Lists all available versions #[command(name = "list-versions")] diff --git a/src/main.rs b/src/main.rs index 18ce2f0..9baa40b 100644 --- a/src/main.rs +++ b/src/main.rs @@ -45,7 +45,7 @@ async fn main() -> Result<()> { process::exit(exit_code); } - args::Command::Refresh => nenv.refresh().await, + args::Command::RemapBinaries => nenv.remap().await, args::Command::ListVersions => nenv.list_versions().await, args::Command::Init => nenv.init_nenv().await, _ => xkcd_unreachable!(), diff --git a/src/nenv.rs b/src/nenv.rs index 22912a8..74011c5 100644 --- a/src/nenv.rs +++ b/src/nenv.rs @@ -101,8 +101,7 @@ impl Nenv { /// Clears the version cache and remaps all executables #[tracing::instrument(skip(self))] - pub async fn refresh(&mut self) -> Result<()> { - Self::clear_version_cache().await?; + pub async fn remap(&mut self) -> Result<()> { self.get_mapper().await?.remap().await }