Skip to content

Commit

Permalink
merge conditionals
Browse files Browse the repository at this point in the history
  • Loading branch information
Schniz committed May 27, 2024
1 parent 9868a12 commit 22623fc
Showing 1 changed file with 6 additions and 12 deletions.
18 changes: 6 additions & 12 deletions src/commands/install.rs
Original file line number Diff line number Diff line change
Expand Up @@ -151,23 +151,17 @@ impl Command for Install {
Ok(()) => {}
};

if let UserVersion::Full(Version::Latest) = current_version {
let alias_name = Version::Latest.v_str();
debug!(
"Tagging {} as alias for {}",
alias_name.cyan(),
version.v_str().cyan()
);
create_alias(config, &alias_name, &version)?;
}

if config.corepack_enabled() {
outln!(config, Info, "Enabling corepack for {}", version_str.cyan());
enable_corepack(&version, config)?;
}

if let UserVersion::Full(Version::Lts(lts_type)) = current_version {
let alias_name = Version::Lts(lts_type).v_str();
if let Some(tagged_alias) = match &current_version {
UserVersion::Full(Version::Latest) => Some(Version::Latest),
UserVersion::Full(Version::Lts(lts_type)) => Some(Version::Lts(lts_type.clone())),
_ => None,
} {
let alias_name = tagged_alias.v_str();
debug!(
"Tagging {} as alias for {}",
alias_name.cyan(),
Expand Down

0 comments on commit 22623fc

Please sign in to comment.