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 Oct 25, 2024
1 parent 5a05831 commit 1c56aa9
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 @@ -87,6 +87,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 1c56aa9

Please sign in to comment.