diff options
author | Óscar Nájera <hi@oscarnajera.com> | 2021-06-03 18:11:37 +0200 |
---|---|---|
committer | Óscar Nájera <hi@oscarnajera.com> | 2021-06-03 18:11:37 +0200 |
commit | fd8a3e5cc66ecff4db7002073ea3f7171f68e830 (patch) | |
tree | 7afc2b3c4dd13d97b1f3c9ab4ed36e4457fda8b8 /install.scm | |
parent | ffbac3868a34e06d80a1f88baaa451ce7823adfe (diff) | |
download | dotfiles-fd8a3e5cc66ecff4db7002073ea3f7171f68e830.tar.gz dotfiles-fd8a3e5cc66ecff4db7002073ea3f7171f68e830.tar.bz2 dotfiles-fd8a3e5cc66ecff4db7002073ea3f7171f68e830.zip |
install cabal config
Diffstat (limited to 'install.scm')
-rwxr-xr-x | install.scm | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/install.scm b/install.scm index 2fa3ad1..a51ee96 100755 --- a/install.scm +++ b/install.scm @@ -97,9 +97,12 @@ (make-dir-parents (dirname dir-path)) (mkdir dir-path))) +(define (dot-replace str) + (replace str "dot-" ".")) + (define (config-links src target dry-run) (let ((src-path (expand-file src)) - (target-path (replace (expand-file target) "dot-" "."))) + (target-path (dot-replace (expand-file target)))) (unless (and (symlink? target-path) (equal? (readlink target-path) src-path)) (rm-tree target-path dry-run) (make-dir-parents (dirname target-path)) @@ -115,7 +118,7 @@ (define (enter? name stat result) (let* ((subdir (substring name src-len)) - (target-subdir (expand-file (string-append target-path subdir)))) + (target-subdir (expand-file (dot-replace (string-append target-path subdir))))) (false-if-exception (eq? 'directory (stat:type (lstat target-subdir)))))) (define (leaf name stat result) @@ -131,7 +134,7 @@ (cons 0 result)) (define (up name stat result) (let* ((subdir (substring name src-len)) - (target-subdir (expand-file (string-append target-path subdir))) + (target-subdir (expand-file (dot-replace (string-append target-path subdir)))) (target-subdir-file-count (length (scandir target-subdir (lambda (x) (not (member x (list "." "..")))))))) |