summaryrefslogtreecommitdiffstats
path: root/lib/shell.nix
diff options
context:
space:
mode:
authorlassulus <lassulus@lassul.us>2017-09-19 22:56:19 +0200
committerlassulus <lassulus@lassul.us>2017-09-19 22:56:19 +0200
commit821e59baca98b5caba65c6e7c7e4d6671593a69e (patch)
tree499e78ef143bf20c7cb2ef4137d031085d25c6a9 /lib/shell.nix
parentd30480f1457cf4ac4f67f5e02faec75765706e50 (diff)
parent94c57badae775cb863b76a6c6cb8c11012cd4f83 (diff)
Merge remote-tracking branch 'ni/master'
Diffstat (limited to 'lib/shell.nix')
-rw-r--r--lib/shell.nix11
1 files changed, 7 insertions, 4 deletions
diff --git a/lib/shell.nix b/lib/shell.nix
index f9779028e..5be8d6759 100644
--- a/lib/shell.nix
+++ b/lib/shell.nix
@@ -7,10 +7,13 @@ rec {
let
isSafeChar = testString "[-+./0-9:=A-Z_a-z]";
in
- stringAsChars (c:
- if isSafeChar c then c
- else if c == "\n" then "'\n'"
- else "\\${c}");
+ x:
+ if x == "" then "''"
+ else stringAsChars (c:
+ if isSafeChar c then c
+ else if c == "\n" then "'\n'"
+ else "\\${c}"
+ ) x;
#
# shell script generators