mirror of
https://github.com/LnL7/nix-darwin.git
synced 2024-08-17 00:20:44 +03:00
Merge pull request #471 from tianyaochou/fix-alias-shell-escape
add escape to shell aliases
This commit is contained in:
commit
b344a20e80
@ -9,7 +9,8 @@ let
|
||||
mapAttrsToList (n: v: ''export ${n}="${v}"'') cfg.variables;
|
||||
|
||||
aliasCommands =
|
||||
mapAttrsFlatten (n: v: ''alias ${n}="${v}"'') cfg.shellAliases;
|
||||
mapAttrsFlatten (n: v: ''alias ${n}=${escapeShellArg v}'')
|
||||
(filterAttrs (k: v: v != null) cfg.shellAliases);
|
||||
|
||||
makeDrvBinPath = concatMapStringsSep ":" (p: if isDerivation p then "${p}/bin" else p);
|
||||
in
|
||||
|
@ -9,7 +9,8 @@ let
|
||||
cfg = config.programs.fish;
|
||||
|
||||
fishAliases = concatStringsSep "\n" (
|
||||
mapAttrsFlatten (k: v: "alias ${k} '${v}'") cfg.shellAliases
|
||||
mapAttrsFlatten (k: v: "alias ${k} ${escapeShellArg v}")
|
||||
(filterAttrs (k: v: v != null) cfg.shellAliases)
|
||||
);
|
||||
|
||||
envShellInit = pkgs.writeText "shellInit" cfge.shellInit;
|
||||
|
@ -43,6 +43,6 @@
|
||||
echo >&2 "checking zsh variables in /etc/zprofile"
|
||||
grep 'FOO="42"' ${config.out}/etc/zprofile
|
||||
echo >&2 "checking shell aliases in /etc/zprofile"
|
||||
grep 'alias ls="ls -G"' ${config.out}/etc/zprofile
|
||||
grep "alias ls='ls -G'" ${config.out}/etc/zprofile
|
||||
'';
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user