Skip to content

Commit

Permalink
run cygpath on use validation too
Browse files Browse the repository at this point in the history
  • Loading branch information
Schniz committed May 17, 2023
1 parent 1e08246 commit 768aca2
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/commands/use.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ use crate::current_version::current_version;
use crate::fs;
use crate::installed_versions;
use crate::outln;
use crate::shell;
use crate::system_version;
use crate::user_version::UserVersion;
use crate::version::Version;
Expand Down Expand Up @@ -190,8 +191,11 @@ fn warn_if_multishell_path_not_in_path_env_var(
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[..]);

for path in std::env::split_paths(&std::env::var("PATH").unwrap_or_default()) {
if bin_path == path {
if bin_path == path || fixed_path == path.to_str() {
return;
}
}
Expand Down
1 change: 1 addition & 0 deletions src/shell/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,5 @@ pub use infer::infer_shell;
pub use powershell::PowerShell;
pub use shell::{Shell, AVAILABLE_SHELLS};
pub use windows_cmd::WindowsCmd;
pub use windows_compat::maybe_fix_windows_path;
pub use zsh::Zsh;

0 comments on commit 768aca2

Please sign in to comment.