Skip to content

Commit

Permalink
One create bin_path and fixed_path when needed
Browse files Browse the repository at this point in the history
  • Loading branch information
mo8it committed Aug 11, 2024
1 parent 4139328 commit be1daa7
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions src/commands/use.rs
Original file line number Diff line number Diff line change
Expand Up @@ -185,16 +185,16 @@ fn warn_if_multishell_path_not_in_path_env_var(
multishell_path: &std::path::Path,
config: &FnmConfig,
) {
let bin_path = if cfg!(unix) {
multishell_path.join("bin")
} else {
multishell_path.to_path_buf()
};
if let Some(path_var) = std::env::var_os("PATH") {
let bin_path = if cfg!(unix) {
multishell_path.join("bin")
} else {
multishell_path.to_path_buf()
};

let fixed_path = bin_path.to_str().and_then(shell::maybe_fix_windows_path);
let fixed_path = fixed_path.as_ref().map(|x| &x[..]);
let fixed_path = bin_path.to_str().and_then(shell::maybe_fix_windows_path);
let fixed_path = fixed_path.as_deref();

if let Some(path_var) = std::env::var_os("PATH") {
for path in std::env::split_paths(&path_var) {
if bin_path == path || fixed_path == path.to_str() {
return;
Expand Down

0 comments on commit be1daa7

Please sign in to comment.