@ -38,17 +38,27 @@ impl Command for Use {
@@ -38,17 +38,27 @@ impl Command for Use {
. context ( CantInferVersion ) ? ;
let version_path = if let UserVersion ::Full ( Version ::Bypassed ) = requested_version {
outln ! ( config #Info , "Bypassing fnm: using {} node" , system_version ::display_name ( ) . cyan ( ) ) ;
outln ! (
config ,
Info ,
"Bypassing fnm: using {} node" ,
system_version ::display_name ( ) . cyan ( )
) ;
system_version ::path ( )
} else if let Some ( alias_name ) = requested_version . alias_name ( ) {
let alias_path = config . aliases_dir ( ) . join ( & alias_name ) ;
let system_path = system_version ::path ( ) ;
if matches! ( fs ::shallow_read_symlink ( & alias_path ) , Ok ( shallow_path ) if shallow_path = = system_path )
{
outln ! ( config #Info , "Bypassing fnm: using {} node" , system_version ::display_name ( ) . cyan ( ) ) ;
outln ! (
config ,
Info ,
"Bypassing fnm: using {} node" ,
system_version ::display_name ( ) . cyan ( )
) ;
system_path
} else if alias_path . exists ( ) {
outln ! ( config #Info , "Using Node for alias {}" , alias_name . cyan ( ) ) ;
outln ! ( config , Info , "Using Node for alias {}" , alias_name . cyan ( ) ) ;
alias_path
} else {
install_new_version ( requested_version , config , self . install_if_missing ) ? ;
@ -57,7 +67,7 @@ impl Command for Use {
@@ -57,7 +67,7 @@ impl Command for Use {
} else {
let current_version = requested_version . to_version ( & all_versions , config ) ;
if let Some ( version ) = current_version {
outln ! ( config # Info , "Using Node {}" , version . to_string ( ) . cyan ( ) ) ;
outln ! ( config , Info , "Using Node {}" , version . to_string ( ) . cyan ( ) ) ;
config
. installations_dir ( )
. join ( version . to_string ( ) )
@ -156,7 +166,7 @@ fn warn_if_multishell_path_not_in_path_env_var(
@@ -156,7 +166,7 @@ fn warn_if_multishell_path_not_in_path_env_var(
}
outln ! (
config # Error ,
config , Error ,
"{} {}\n{}\n{}" ,
"warning:" . yellow ( ) . bold ( ) ,
"The current Node.js path is not on your PATH environment variable." . yellow ( ) ,