From 64dfee80d86b8f969a037945b7a5ce671e74fb0b Mon Sep 17 00:00:00 2001 From: Wynn Wolf Arbor Date: Mon, 20 Jan 2020 21:50:07 +0100 Subject: 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. --- bosun | 14 ++++++-------- 1 file 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() { -- cgit v1.2.3-2-gb3c3