about summary refs log tree commit diff
diff options
context:
space:
mode:
authoronur-ozkan <work@onurozkan.dev>2023-10-02 20:48:53 +0300
committeronur-ozkan <work@onurozkan.dev>2023-10-02 20:48:53 +0300
commit2c8759ef8a91b70b567a7459694635ed70c19248 (patch)
tree0038296fe65055a2ae540daa06305b78838f4d9f
parentb0889cb4ed0e6f3ed9f440180678872b02e7052c (diff)
downloadrust-2c8759ef8a91b70b567a7459694635ed70c19248.tar.gz
rust-2c8759ef8a91b70b567a7459694635ed70c19248.zip
ensure the parent path's existence on `x install`
Signed-off-by: onur-ozkan <work@onurozkan.dev>
-rw-r--r--src/bootstrap/install.rs6
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) => {