diff options
author | lassulus <lassulus@lassul.us> | 2017-09-19 22:56:19 +0200 |
---|---|---|
committer | lassulus <lassulus@lassul.us> | 2017-09-19 22:56:19 +0200 |
commit | 821e59baca98b5caba65c6e7c7e4d6671593a69e (patch) | |
tree | 499e78ef143bf20c7cb2ef4137d031085d25c6a9 /lib/shell.nix | |
parent | d30480f1457cf4ac4f67f5e02faec75765706e50 (diff) | |
parent | 94c57badae775cb863b76a6c6cb8c11012cd4f83 (diff) |
Merge remote-tracking branch 'ni/master'
Diffstat (limited to 'lib/shell.nix')
-rw-r--r-- | lib/shell.nix | 11 |
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 |