Skip to content
This repository was archived by the owner on Aug 25, 2024. It is now read-only.

Commit 6e86f93

Browse files
committed
util: skel: Create parent directory for link if not exists
Signed-off-by: John Andersen <[email protected]>
1 parent 9b3c15b commit 6e86f93

File tree

2 files changed

+4
-0
lines changed

2 files changed

+4
-0
lines changed

dffml/skel/.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
*/LICENSE
22
*/.gitignore
3+
*/.github
34
*/.coveragerc
45
*/setup_common.py
56
*/pyproject.toml

dffml/util/skel.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,9 @@ def create_symlinks(self, plugin):
6060
filepath = Path("..") / filepath
6161
if self.common == path:
6262
break
63+
# Create parent directories of link if they do not exist
64+
if not linkpath.parent.is_dir():
65+
linkpath.parent.mkdir(parents=True)
6366
# Resolving first gives more helpful error message if it fails
6467
linkpath.resolve().symlink_to(filepath)
6568

0 commit comments

Comments
 (0)