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`
This commit is contained in:
commit
d7621cdb19
@ -46,10 +46,10 @@ fn sanitize_sh(path: &Path) -> String {
|
|||||||
}
|
}
|
||||||
|
|
||||||
fn is_dir_writable_for_user(dir: &PathBuf) -> bool {
|
fn is_dir_writable_for_user(dir: &PathBuf) -> bool {
|
||||||
let tmp_file = dir.join(".tmp");
|
let tmp = dir.join(".tmp");
|
||||||
match fs::File::create(&tmp_file) {
|
match fs::create_dir_all(&tmp) {
|
||||||
Ok(_) => {
|
Ok(_) => {
|
||||||
fs::remove_file(tmp_file).unwrap();
|
fs::remove_dir_all(tmp).unwrap();
|
||||||
true
|
true
|
||||||
}
|
}
|
||||||
Err(e) => {
|
Err(e) => {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user