Skip to content

Commit a66e4e1

Browse files
Read env.sh locally but write env
1 parent 9488dac commit a66e4e1

File tree

3 files changed

+7
-7
lines changed

3 files changed

+7
-7
lines changed

src/cli/self_update.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,7 @@ To get started you need Cargo's bin directory ({cargo_home}/bin) in your `PATH`
161161
environment variable. Next time you log in this will be done
162162
automatically.
163163
164-
To configure your current shell run `source {cargo_home}/env.sh`
164+
To configure your current shell run `source {cargo_home}/env`
165165
"
166166
};
167167
}
@@ -184,7 +184,7 @@ macro_rules! post_install_msg_unix_no_modify_path {
184184
To get started you need Cargo's bin directory ({cargo_home}/bin) in your `PATH`
185185
environment variable.
186186
187-
To configure your current shell run `source {cargo_home}/env.sh`
187+
To configure your current shell run `source {cargo_home}/env`
188188
"
189189
};
190190
}

src/cli/self_update/shell.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -92,13 +92,13 @@ pub trait UnixShell {
9292
// Writes the relevant env file.
9393
fn env_script(&self) -> ShellScript {
9494
ShellScript {
95-
name: "env.sh",
95+
name: "env",
9696
content: include_str!("env.sh"),
9797
}
9898
}
9999

100100
fn source_string(&self) -> Result<String> {
101-
Ok(format!(r#"source "{}/env.sh""#, cargo_home_str()?))
101+
Ok(format!(r#"source "{}/env""#, cargo_home_str()?))
102102
}
103103
}
104104

tests/cli-paths.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ source ~/fruit/punch
2929
export PATH="$HOME/apple/bin"
3030
"#;
3131
const DEFAULT_EXPORT: &str = "export PATH=\"$HOME/.cargo/bin:$PATH\"\n";
32-
const POSIX_SH: &str = "env.sh";
32+
const POSIX_SH: &str = "env";
3333

3434
fn source(dir: impl Display, sh: impl Display) -> String {
3535
format!("source \"{dir}/{sh}\"\n", dir = dir, sh = sh)
@@ -49,7 +49,7 @@ export PATH="$HOME/apple/bin"
4949
// otherwise the literal path will be written to the file.
5050

5151
let mut cmd = clitools::cmd(config, "rustup-init", &INIT_NONE[1..]);
52-
let files: Vec<PathBuf> = [".cargo/env.sh", ".profile", ".zshenv"]
52+
let files: Vec<PathBuf> = [".cargo/env", ".profile", ".zshenv"]
5353
.iter()
5454
.map(|file| config.homedir.join(file))
5555
.collect();
@@ -282,7 +282,7 @@ export PATH="$HOME/apple/bin"
282282
assert!(cmd.output().unwrap().status.success());
283283

284284
let new_profile = fs::read_to_string(&profile).unwrap();
285-
let expected = format!("{}source \"$HOME/.cargo/env.sh\"\n", FAKE_RC);
285+
let expected = format!("{}source \"$HOME/.cargo/env\"\n", FAKE_RC);
286286
assert_eq!(new_profile, expected);
287287

288288
let mut cmd = clitools::cmd(config, "rustup", &["self", "uninstall", "-y"]);

0 commit comments

Comments
 (0)