zplug: Reduce noise (#1441)

Running `zplug install` will always product output, even if there is
nothing to do.

Gating it behind a `zplug check` eliminates that output when there is
nothing to do, and is recommended in the zplug README.
This commit is contained in:
Paho Lurie-Gregg 2020-09-06 02:16:34 -07:00 committed by GitHub
parent f146620897
commit 1a6d6b8ace
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 9 additions and 4 deletions

View file

@ -45,11 +45,14 @@ in {
optionalString (plugin.tags != [ ]) '' optionalString (plugin.tags != [ ]) ''
${concatStrings (map (tag: ", ${tag}") plugin.tags)} ${concatStrings (map (tag: ", ${tag}") plugin.tags)}
'' ''
} }
'') cfg.plugins)} '') cfg.plugins)}
''} ''}
zplug install if ! zplug check; then
zplug install
fi
zplug load zplug load
''; '';

View file

@ -38,8 +38,10 @@ with lib;
assertFileContains home-files/.zshrc \ assertFileContains home-files/.zshrc \
'zplug "lib/clipboard", from:oh-my-zsh, if:"[[ $OSTYPE == *darwin* ]]"' 'zplug "lib/clipboard", from:oh-my-zsh, if:"[[ $OSTYPE == *darwin* ]]"'
assertFileRegex home-files/.zshrc \ assertFileContains home-files/.zshrc \
'^zplug install$' 'if ! zplug check; then
zplug install
fi'
assertFileRegex home-files/.zshrc \ assertFileRegex home-files/.zshrc \
'^zplug load$' '^zplug load$'