aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorWolfgang Müller2021-03-10 16:29:47 +0100
committerWolfgang Müller2021-03-10 16:29:47 +0100
commit0a549b991db4d40a2e5281e39b77a23745f8d3d6 (patch)
tree73ba32003cc3637330fe656b62af81ee495639de
parent736d17991fbe7aa468e62824b34c62396b01ab20 (diff)
downloadbosun-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-xbosun4
1 files changed, 2 insertions, 2 deletions
diff --git a/bosun b/bosun
index d9dc4c7..d8d0168 100755
--- a/bosun
+++ b/bosun
@@ -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
}