diff options
author | Wolfgang Müller | 2021-03-10 16:29:47 +0100 |
---|---|---|
committer | Wolfgang Müller | 2021-03-10 16:29:47 +0100 |
commit | 0a549b991db4d40a2e5281e39b77a23745f8d3d6 (patch) | |
tree | 73ba32003cc3637330fe656b62af81ee495639de | |
parent | 736d17991fbe7aa468e62824b34c62396b01ab20 (diff) | |
download | bosun-0a549b991db4d40a2e5281e39b77a23745f8d3d6.tar.gz |
Do not act if there is nothing to flush or rebuild
By default, xargs runs the given command once even if there is no input.
This does not make sense for these two invocations, so make sure that
xargs only runs if active roles were found. Furthermore, state
explicitly which command to run and do not rely on the default action of
'list'.
Note: This change makes use of the '-r' flag, which is a GNU extension.
We assume that bosun is only ever going to be used on Gentoo systems, so
this should be fine.
-rwxr-xr-x | bosun | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -38,7 +38,7 @@ remove() { } flush() { - list | xargs -- stow -D + list active | xargs -r -- stow -D } rebuild() { @@ -46,7 +46,7 @@ rebuild() { need_role "$@" stow -R "$@" else - list | xargs -- stow -R + list active | xargs -r -- stow -R fi } |