From bf73add1573498c21bbbd27eb262c3e9c2fe0bb3 Mon Sep 17 00:00:00 2001 From: Tobias Florek Date: Thu, 27 Apr 2023 12:02:26 +0200 Subject: [PATCH] create parent dir when linking file fixes #161 --- src/paths/mod.rs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/paths/mod.rs b/src/paths/mod.rs index 42b0f3cb..86d782f1 100644 --- a/src/paths/mod.rs +++ b/src/paths/mod.rs @@ -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| {