diff options
-rw-r--r-- | modules/programs/zplug.nix | 7 | ||||
-rw-r--r-- | tests/modules/programs/zplug/modules.nix | 6 |
2 files changed, 9 insertions, 4 deletions
diff --git a/modules/programs/zplug.nix b/modules/programs/zplug.nix index 0df395292a7..6cb5e98e313 100644 --- a/modules/programs/zplug.nix +++ b/modules/programs/zplug.nix @@ -45,11 +45,14 @@ in { optionalString (plugin.tags != [ ]) '' ${concatStrings (map (tag: ", ${tag}") plugin.tags)} '' - } + } '') cfg.plugins)} ''} - zplug install + if ! zplug check; then + zplug install + fi + zplug load ''; diff --git a/tests/modules/programs/zplug/modules.nix b/tests/modules/programs/zplug/modules.nix index 8ebf82b861f..704c5c5e2ef 100644 --- a/tests/modules/programs/zplug/modules.nix +++ b/tests/modules/programs/zplug/modules.nix @@ -38,8 +38,10 @@ with lib; assertFileContains home-files/.zshrc \ 'zplug "lib/clipboard", from:oh-my-zsh, if:"[[ $OSTYPE == *darwin* ]]"' - assertFileRegex home-files/.zshrc \ - '^zplug install$' + assertFileContains home-files/.zshrc \ + 'if ! zplug check; then + zplug install + fi' assertFileRegex home-files/.zshrc \ '^zplug load$' |