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.
1 parent ab1b36d commit 4c14853Copy full SHA for 4c14853
src/command/setup.rs
@@ -43,6 +43,16 @@ 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.root()),
49
+ None => None
50
+ };
51
+
52
+ if env::var_os("VOLTA_HOME").is_some() && home_in_path.is_some() {
53
+ return Ok(());
54
+ }
55
56
debug!("Searching for profiles to update");
57
let profiles = determine_profiles()?;
58
0 commit comments