From fd8a3e5cc66ecff4db7002073ea3f7171f68e830 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=93scar=20N=C3=A1jera?= Date: Thu, 3 Jun 2021 18:11:37 +0200 Subject: install cabal config --- install.scm | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'install.scm') 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 "." "..")))))))) -- cgit v1.2.3