[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[bug#60521] [PATCH] home: Add home-stow-migration-service.
From: |
Ludovic Courtès |
Subject: |
[bug#60521] [PATCH] home: Add home-stow-migration-service. |
Date: |
Mon, 29 Jan 2024 14:20:10 +0100 |
User-agent: |
Gnus/5.13 (Gnus v5.13) |
Sergey Trofimov <sarg@sarg.org.ru> skribis:
> (define* (as-local-files dir #:optional (trim-prefix dir))
> (let ((absolute-dir (string-append (getcwd) "/" dir))
> (to-trim (string-append (getcwd) "/" trim-prefix "/")))
> (map (lambda (fn)
> (list
> (del-prefix to-trim fn)
> (local-file (canonicalize-path fn) (del-prefix "."
> (basename fn)) #:recursive? #t)))
> (find-files absolute-dir))))
As you saw, I proposed a different solution: capturing
(current-source-directory) in ‘home-dotfiles-configuration’ and using
that to compute absolute file names (without ever calling
‘canonicalize-path’).
Using ‘getcwd’ would be incorrect or at least surprising: it would
resolve file names relative to the current directory instead of relative
to the directory that contains the source file.
Ludo’.