From d0358bb08599ea4fe52fbe5bab1639bcd3bf71e3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=93scar=20N=C3=A1jera?= Date: Thu, 22 Oct 2020 19:08:53 +0200 Subject: Config link does not receive title It always does a symlink, thus no need to name it --- install.scm | 23 +++++++++++++---------- 1 file changed, 13 insertions(+), 10 deletions(-) (limited to 'install.scm') 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)) -- cgit v1.2.3