summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authornin <nineinchnade@gmail.com>2017-09-29 19:11:43 +0200
committernin <nineinchnade@gmail.com>2017-09-29 19:11:43 +0200
commit93d67cfb618d8f8aff014ecbd6abbf9325cb5f84 (patch)
tree16e8bca30144e7f74eaad7da314ec46b30e3d5f1 /lib
parent5525fb770f0705e0284aee020ee1f3bbacfeb8d6 (diff)
parent19686c0786aab7556599c8160e81cde3e3ea952a (diff)
Merge branch 'master' of prism:stockholm
Diffstat (limited to 'lib')
-rw-r--r--lib/shell.nix11
1 files changed, 7 insertions, 4 deletions
diff --git a/lib/shell.nix b/lib/shell.nix
index f977902..5be8d67 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