fix: respect sudo choice
This commit is contained in:
parent
3ed6e5b8e2
commit
15082cac1f
7
xif
7
xif
|
@ -1,8 +1,6 @@
|
|||
#!/bin/sh
|
||||
# vim: set ts=4 sw=4 et:
|
||||
|
||||
command -v fzf >/dev/null || sudo xbps-install -S fzf
|
||||
|
||||
[ -z "$*" ] && echo "xif: empty search term" && exit 1
|
||||
|
||||
filter='/^.[i*]. /d'
|
||||
|
@ -38,12 +36,13 @@ pkgs() {
|
|||
cut -d' ' -f1 | tr '\n' ' ' | sed "s/ $//"
|
||||
}
|
||||
|
||||
SUDO=$(which_sudo)
|
||||
command -v fzf >/dev/null || $SUDO xbps-install -S fzf
|
||||
|
||||
PKGS="$(pkgs $@)"
|
||||
[ -z "$PKGS" ] && exit 130
|
||||
|
||||
SUDO=$(which_sudo)
|
||||
install -S $PKGS
|
||||
|
||||
status=$?
|
||||
if [ $status -eq 16 ]; then
|
||||
install -u xbps &&
|
||||
|
|
Loading…
Reference in New Issue