diff options
| author | Tyler Mandry <tmandry@gmail.com> | 2023-10-02 16:09:43 -0400 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-10-02 16:09:43 -0400 |
| commit | d7621cdb19efe246b62f2d25ed9bfe3afe6f2917 (patch) | |
| tree | 4c9d88af4948cd916d394a20efd341c2447d1e66 | |
| parent | 1edf7233faefe64265898db10f5df4b57e9beb5d (diff) | |
| parent | 2c8759ef8a91b70b567a7459694635ed70c19248 (diff) | |
| download | rust-d7621cdb19efe246b62f2d25ed9bfe3afe6f2917.tar.gz rust-d7621cdb19efe246b62f2d25ed9bfe3afe6f2917.zip | |
Rollup merge of #116349 - onur-ozkan:hfix, r=tmandry
ensure the parent path's existence on `x install` fixes https://github.com/rust-lang/rust/pull/116127#issuecomment-1743454109 cc `@tmandry`
| -rw-r--r-- | src/bootstrap/install.rs | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/bootstrap/install.rs b/src/bootstrap/install.rs index 85cd8abb995..885b3a78236 100644 --- a/src/bootstrap/install.rs +++ b/src/bootstrap/install.rs @@ -46,10 +46,10 @@ fn sanitize_sh(path: &Path) -> String { } fn is_dir_writable_for_user(dir: &PathBuf) -> bool { - let tmp_file = dir.join(".tmp"); - match fs::File::create(&tmp_file) { + let tmp = dir.join(".tmp"); + match fs::create_dir_all(&tmp) { Ok(_) => { - fs::remove_file(tmp_file).unwrap(); + fs::remove_dir_all(tmp).unwrap(); true } Err(e) => { |
