aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorWynn Wolf Arbor2020-01-20 21:50:07 +0100
committerWynn Wolf Arbor2020-01-20 21:50:07 +0100
commit64dfee80d86b8f969a037945b7a5ce671e74fb0b (patch)
treece7fe0e52dfe2b8cce41131dba9597b0bbce09f5
parentde30b45b62b6940230315f61d4ee48c0f59f2914 (diff)
downloadbosun-64dfee80d86b8f969a037945b7a5ce671e74fb0b.tar.gz
Simplify invocation of stow
Instead of hard-coding the stow invocation (which also had a quoting issue), just export the STOW_DIR environment variable which stow uses already. TARGET can be dropped because it is implicitly defined to be the parent directory of STOW_DIR.
-rwxr-xr-xbosun14
1 files changed, 6 insertions, 8 deletions
diff --git a/bosun b/bosun
index 3351dbc..49ba22c 100755
--- a/bosun
+++ b/bosun
@@ -1,9 +1,7 @@
#!/bin/sh
-STOW_DIR=/etc/portage/stow
-TARGET=/etc/portage
-
-stowcmd="stow -d "$STOW_DIR" -t "$TARGET""
+# allow overriding STOW_DIR by the user
+export STOW_DIR=${STOW_DIR:-/etc/portage/stow}
need_root() {
if test $(id -u) -ne 0; then
@@ -14,22 +12,22 @@ need_root() {
add() {
need_root
- $stowcmd -S "$@"
+ stow -S "$@"
}
remove() {
need_root
- $stowcmd -D "$@"
+ stow -D "$@"
}
flush() {
need_root
- list | xargs -- $stowcmd -D
+ list | xargs -- stow -D
}
rebuild() {
need_root
- list | xargs -- $stowcmd -R
+ list | xargs -- stow -R
}
list() {