Skip to content

Commit bdcf933

Browse files
committed
apply review feedback
1 parent 2bb4c25 commit bdcf933

File tree

1 file changed

+6
-3
lines changed
  • crates/volta-core/src/tool

1 file changed

+6
-3
lines changed

crates/volta-core/src/tool/mod.rs

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ use crate::session::Session;
66
use crate::style::{note_prefix, success_prefix, tool_version};
77
use crate::sync::VoltaLock;
88
use crate::version::VersionSpec;
9+
use cfg_if::cfg_if;
910
use log::{debug, info};
1011

1112
pub mod node;
@@ -201,19 +202,21 @@ pub fn check_shim_reachable(shim_name: &str) {
201202
};
202203

203204
let shim = home.shim_file(shim_name);
205+
let path_var_name = cfg_if!(if #[cfg(windows)] { "Path" } else { "PATH" });
204206
let resolved = match which::which(shim_name) {
205207
Ok(resolved) => resolved,
206208
Err(_) => {
207209
info!(
208-
"{} cannot find command {}. Please ensure that {} is at the front of your PATH.",
210+
"{} cannot find command {}. Please ensure that {} is available on your {}.",
209211
note_prefix(),
210212
shim_name,
211-
shim.display()
213+
home.shim_dir(),
214+
path_var_name,
212215
);
213216
return;
214217
}
215218
};
216219
if resolved != shim {
217-
info!("{} {} is shadowed by another binary of the same name at {}. Please ensure that {} is at the front of your PATH.", note_prefix(), shim_name, resolved.display(), shim.display());
220+
info!("{} {} is shadowed by another binary of the same name at {}. To ensure your commands work as expected, please move {} to the start of your {}.", note_prefix(), shim_name, resolved.display(), home.shim_dir(), path_var_name);
218221
}
219222
}

0 commit comments

Comments
 (0)