Skip to content

Commit

Permalink
create parent dir when linking file
Browse files Browse the repository at this point in the history
  • Loading branch information
ibotty committed Apr 27, 2023
1 parent 8449e66 commit 8285b32
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/paths/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,10 @@ impl DotPaths for Dot {
}
}

if let Some(parent) = target.parent() {
fs::create_dir_all(parent)?;
}

// Link
unix::fs::symlink(copy_path, target)
.map_err(|cause| {
Expand Down

0 comments on commit 8285b32

Please sign in to comment.