aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rwxr-xr-xinstall.scm6
1 files changed, 6 insertions, 0 deletions
diff --git a/install.scm b/install.scm
index c4190e0..2fa3ad1 100755
--- a/install.scm
+++ b/install.scm
@@ -92,11 +92,17 @@
(define (replace str pattern new)
(regexp-substitute/global #f pattern str 'pre new 'post))
+(define (make-dir-parents dir-path)
+ (unless (access? dir-path F_OK)
+ (make-dir-parents (dirname dir-path))
+ (mkdir dir-path)))
+
(define (config-links src target dry-run)
(let ((src-path (expand-file src))
(target-path (replace (expand-file target) "dot-" ".")))
(unless (and (symlink? target-path) (equal? (readlink target-path) src-path))
(rm-tree target-path dry-run)
+ (make-dir-parents (dirname target-path))
(symlink src-path target-path)
(log-msg 'OK (string-append " Symlink " src " -> " target)))))