zsh: correctly handle autoloading functions starting with '-'
This commit is contained in:
@@ -22,7 +22,7 @@
|
||||
zsh-legacy-warning = ./legacy-warning.nix;
|
||||
zsh-oh-my-zsh-custom = ./oh-my-zsh-custom.nix;
|
||||
zsh-plugins-completions-renamed = ./plugins-completions-renamed.nix;
|
||||
zsh-siteFunctions-mkcd = ./siteFunctions-mkcd.nix;
|
||||
zsh-siteFunctions = ./siteFunctions.nix;
|
||||
zsh-plugins = ./plugins.nix;
|
||||
zsh-prezto = ./prezto.nix;
|
||||
zsh-session-variables = ./session-variables.nix;
|
||||
|
||||
@@ -1,17 +0,0 @@
|
||||
let
|
||||
body = ''
|
||||
mkdir --parents "$1" && cd "$1"
|
||||
'';
|
||||
in
|
||||
{
|
||||
programs.zsh = {
|
||||
enable = true;
|
||||
siteFunctions.mkcd = body;
|
||||
};
|
||||
|
||||
nmt.script = ''
|
||||
assertFileExists home-path/share/zsh/site-functions/mkcd
|
||||
assertFileContent home-path/share/zsh/site-functions/mkcd ${builtins.toFile "mkcd" body}
|
||||
assertFileContains home-files/.zshrc "autoload -Uz mkcd"
|
||||
'';
|
||||
}
|
||||
@@ -0,0 +1,23 @@
|
||||
let
|
||||
mkcd-body = ''
|
||||
mkdir --parents "$1" && cd "$1"
|
||||
'';
|
||||
hidden-body = ''
|
||||
echo "doing some hidden magic"
|
||||
'';
|
||||
in
|
||||
{
|
||||
programs.zsh = {
|
||||
enable = true;
|
||||
siteFunctions.mkcd = mkcd-body;
|
||||
siteFunctions."-hidden-function" = hidden-body;
|
||||
};
|
||||
|
||||
nmt.script = ''
|
||||
assertFileExists home-path/share/zsh/site-functions/mkcd
|
||||
assertFileExists home-path/share/zsh/site-functions/-hidden-function
|
||||
assertFileContent home-path/share/zsh/site-functions/mkcd ${builtins.toFile "mkcd" mkcd-body}
|
||||
assertFileContent home-path/share/zsh/site-functions/-hidden-function ${builtins.toFile "-hidden-function" hidden-body}
|
||||
assertFileContains home-files/.zshrc "autoload -Uz -- -hidden-function mkcd"
|
||||
'';
|
||||
}
|
||||
Reference in New Issue
Block a user