Skip to content

Commit 7050161

Browse files
authored
Merge pull request #2414 from rhysd/fix-path-sep-win
Fix path to rustup.exe and rustup-init.exe on self-update
2 parents 0242e95 + 4bfccbe commit 7050161

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/cli/self_update.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ use std::borrow::Cow;
3434
use std::env;
3535
use std::env::consts::EXE_SUFFIX;
3636
use std::fs;
37-
use std::path::{Component, Path, PathBuf};
37+
use std::path::{Component, Path, PathBuf, MAIN_SEPARATOR};
3838
use std::process::Command;
3939

4040
use same_file::Handle;
@@ -959,8 +959,8 @@ fn parse_new_rustup_version(version: String) -> String {
959959

960960
pub fn prepare_update() -> Result<Option<PathBuf>> {
961961
let cargo_home = utils::cargo_home()?;
962-
let rustup_path = cargo_home.join(&format!("bin/rustup{}", EXE_SUFFIX));
963-
let setup_path = cargo_home.join(&format!("bin/rustup-init{}", EXE_SUFFIX));
962+
let rustup_path = cargo_home.join(&format!("bin{}rustup{}", MAIN_SEPARATOR, EXE_SUFFIX));
963+
let setup_path = cargo_home.join(&format!("bin{}rustup-init{}", MAIN_SEPARATOR, EXE_SUFFIX));
964964

965965
if !rustup_path.exists() {
966966
return Err(ErrorKind::NotSelfInstalled(cargo_home).into());

0 commit comments

Comments
 (0)