We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 2b45680 + 6e2129c commit 4567250Copy full SHA for 4567250
src/command/setup.rs
@@ -43,6 +43,19 @@ mod os {
43
let home = volta_home()?;
44
let formatted_home = format_home(home.root());
45
46
+ // Don't update the user's shell config files if VOLTA_HOME and PATH already contain what we need.
47
+ let home_in_path = match env::var_os("PATH") {
48
+ Some(paths) => env::split_paths(&paths).find(|p| p == home.shim_dir()),
49
+ None => None,
50
+ };
51
+
52
+ if env::var_os("VOLTA_HOME").is_some() && home_in_path.is_some() {
53
+ debug!(
54
+ "Skipping dot-file modification as VOLTA_HOME is set, and included in the PATH."
55
+ );
56
+ return Ok(());
57
+ }
58
59
debug!("Searching for profiles to update");
60
let profiles = determine_profiles()?;
61
0 commit comments