diff options
-rwxr-xr-x | install.scm | 23 |
1 files changed, 13 insertions, 10 deletions
diff --git a/install.scm b/install.scm index de36b33..d5c42d9 100755 --- a/install.scm +++ b/install.scm @@ -5,6 +5,7 @@ (logging logger) (logging port-log) (ice-9 ftw) + (ice-9 match) (oop goops) (term ansi-color)) @@ -61,36 +62,38 @@ (log-msg 'WARN (string-append "Deleting previous file: " full-dest)) (delete-file full-dest))) -(define (config-links title src target) +(define (config-links src target) (let ((src-path (expand-file src)) (target-path (expand-file target))) (unless (and (symlink? target-path) (equal? (readlink target-path) src-path)) (clean-file target-path) (symlink src-path target-path) - (log-msg 'OK (string-append title " on " target))))) + (log-msg 'OK (string-append "Symlink" src " -> " target))))) (define (git-config) (log-msg 'INFO "Configuring git") - (config-links " Symlink global config" "git/global-gitconfig" "~/.gitconfig") - (config-links " Symlink Tribe29 config" "git/tribe29" "~/git/.gitconfig")) + (log-msg 'INFO " Symlink global config") + (config-links "git/global-gitconfig" "~/.gitconfig") + (log-msg 'INFO " Symlink Tribe29 config") + (config-links "git/tribe29" "~/git/.gitconfig")) (define (symlink-dir dir target-dir) (let ((cur (getcwd))) (chdir dir) (map (lambda (cmd) - (config-links (string-append " Symlink " cmd) cmd (string-append target-dir cmd))) + (config-links cmd (string-append target-dir cmd))) (scandir "." (lambda (f) (eq? 'regular (stat:type (stat f)))))) (chdir cur))) (define (main args) (setup-logging) (log-msg 'INFO "Symlink PIM") - (config-links " Symlink agenda" "calendars.conf" "~/.calendars.conf") + (config-links "calendars.conf" "~/.calendars.conf") (git-config) - (config-links " Symlink guile defaults" "dot-guile" "~/.guile") - (config-links " Symlink rofi" "rofi" "~/.config/rofi") - (config-links " Symlink zshrc" "dot-zshrc" "~/.zshrc") - (config-links " Symlink gpg-agent" "gnupu/gpg-agent.conf" "~/.gnupg/gpg-agent") + (config-links "dot-guile" "~/.guile") + (config-links "rofi" "~/.config/rofi") + (config-links "dot-zshrc" "~/.zshrc") + (config-links "gnupu/gpg-agent.conf" "~/.gnupg/gpg-agent") (symlink-dir "bin" "~/.local/bin/") (shutdown-logging)) |