aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorGravatar Jonas Gunz <himself@jonasgunz.de> 2022-12-05 01:47:09 +0100
committerGravatar Jonas Gunz <himself@jonasgunz.de> 2022-12-05 01:47:09 +0100
commit73667159d9907cfd0695c3fdd7c0a2f31a6fee79 (patch)
tree3a2632add536c1a988bb3eb9cd8a8529cc49a399 /lib
parente9f52f24c29f798d618c6e8e68ceabbd86bd0c6c (diff)
downloaddotfiles-73667159d9907cfd0695c3fdd7c0a2f31a6fee79.tar.gz
link: create folders, if they don't exist
Diffstat (limited to 'lib')
-rw-r--r--lib/funcs.sh5
1 files changed, 5 insertions, 0 deletions
diff --git a/lib/funcs.sh b/lib/funcs.sh
index 0122c60..585c4aa 100644
--- a/lib/funcs.sh
+++ b/lib/funcs.sh
@@ -84,6 +84,11 @@ link() {
fi
fi
+ if [ ! -d "$(dirname $2)" ]; then
+ debug "$(dirname $2) does not exit. Creating it."
+ mkdir -p "$(dirname $2)"
+ fi
+
ln -s "$1" "$2"
}