Skip to content

Commit 2c8759e

Browse files
committed
ensure the parent path's existence on x install
Signed-off-by: onur-ozkan <work@onurozkan.dev>
1 parent b0889cb commit 2c8759e

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/bootstrap/install.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -46,10 +46,10 @@ fn sanitize_sh(path: &Path) -> String {
4646
}
4747

4848
fn is_dir_writable_for_user(dir: &PathBuf) -> bool {
49-
let tmp_file = dir.join(".tmp");
50-
match fs::File::create(&tmp_file) {
49+
let tmp = dir.join(".tmp");
50+
match fs::create_dir_all(&tmp) {
5151
Ok(_) => {
52-
fs::remove_file(tmp_file).unwrap();
52+
fs::remove_dir_all(tmp).unwrap();
5353
true
5454
}
5555
Err(e) => {

0 commit comments

Comments
 (0)