summaryrefslogtreecommitdiff
path: root/gnu/home/services/shells.scm
diff options
context:
space:
mode:
Diffstat (limited to 'gnu/home/services/shells.scm')
-rw-r--r--gnu/home/services/shells.scm28
1 files changed, 18 insertions, 10 deletions
diff --git a/gnu/home/services/shells.scm b/gnu/home/services/shells.scm
index 415b5470c5..7960590e7c 100644
--- a/gnu/home/services/shells.scm
+++ b/gnu/home/services/shells.scm
@@ -313,16 +313,24 @@ source ~/.profile
;;;
(define (bash-serialize-aliases field-name val)
- #~(string-append
- #$@(map
- (match-lambda
- ((key . #f)
- "")
- ((key . #t)
- #~(string-append "alias " #$key "\n"))
- ((key . value)
- #~(string-append "alias " #$key "=\"" #$value "\"\n")))
- val)))
+ (with-shell-quotation-bindings
+ #~(string-append
+ #$@(map
+ (match-lambda
+ ((key . #f)
+ "")
+ ((key . #t)
+ #~(string-append "alias " #$key "\n"))
+ ((key . (? literal-string? value))
+ #~(string-append "alias " #$key "="
+ (shell-single-quote
+ #$(literal-string-value value))
+ "\n"))
+ ((key . value)
+ #~(string-append "alias " #$key "="
+ (shell-double-quote #$value)
+ "\n")))
+ val))))
(define-configuration home-bash-configuration
(package