Skip to content

Commit

Permalink
create parent dir when linking file
Browse files Browse the repository at this point in the history
fixes #161
  • Loading branch information
ibotty committed Oct 25, 2024
1 parent d3bd97d commit bf73add
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)?;
}

Check warning on line 92 in src/paths/mod.rs

View check run for this annotation

Codecov / codecov/patch

src/paths/mod.rs#L92

Added line #L92 was not covered by tests

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

0 comments on commit bf73add

Please sign in to comment.