Rename refresh to remap-binaries

feature/lookup-installed
trivernis 2 years ago
parent a081ea88de
commit 1ac8eec5f3
Signed by: Trivernis
GPG Key ID: DFFFCC2C7A02DB45

@ -28,10 +28,12 @@ pub enum Command {
#[command()] #[command()]
Default(DefaultArgs), Default(DefaultArgs),
/// Refreshes the node environment mappings and cache. /// Creates wrapper scripts for node binaries
/// This will erase all binary mappings not relevant to the current node version. /// 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()] #[command()]
Refresh, RemapBinaries,
/// Lists all available versions /// Lists all available versions
#[command(name = "list-versions")] #[command(name = "list-versions")]

@ -45,7 +45,7 @@ async fn main() -> Result<()> {
process::exit(exit_code); 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::ListVersions => nenv.list_versions().await,
args::Command::Init => nenv.init_nenv().await, args::Command::Init => nenv.init_nenv().await,
_ => xkcd_unreachable!(), _ => xkcd_unreachable!(),

@ -101,8 +101,7 @@ impl Nenv {
/// Clears the version cache and remaps all executables /// Clears the version cache and remaps all executables
#[tracing::instrument(skip(self))] #[tracing::instrument(skip(self))]
pub async fn refresh(&mut self) -> Result<()> { pub async fn remap(&mut self) -> Result<()> {
Self::clear_version_cache().await?;
self.get_mapper().await?.remap().await self.get_mapper().await?.remap().await
} }

Loading…
Cancel
Save