summaryrefslogtreecommitdiffstats
path: root/lib/shell.nix
diff options
context:
space:
mode:
authormakefu <github@syntax-fehler.de>2017-09-29 21:28:23 +0200
committermakefu <github@syntax-fehler.de>2017-09-29 21:28:23 +0200
commitc352397385d5e7cbf2095ead0aa4a74be116da34 (patch)
tree72a730cb2b451b5700a8eaf9420b4bd46f513ba9 /lib/shell.nix
parent9d9e9bc3d8087974370e3d62bc05d2332b2efab2 (diff)
parent37951eed3dd7806f73c40c47ec9cd047ad76c15d (diff)
Merge remote-tracking branch 'lass/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