Skip to content

Commit b5d42ce

Browse files
committed
If there is no /usr/local/bin/pkgx then install too
1 parent 48cf276 commit b5d42ce

1 file changed

Lines changed: 6 additions & 9 deletions

File tree

installer.sh

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -82,17 +82,14 @@ _install_pkgx() {
8282
}
8383

8484
_should_install_pkgx() {
85-
if ! command -v pkgx >/dev/null 2>&1; then
85+
if [ -x /usr/local/bin/pkgx ] && [ -f /usr/local/bin/pkgx ]; then
86+
# if the installed version is less than the available version then upgrade
87+
/usr/local/bin/pkgx --silent semverator gt \
88+
$(curl -Ssf https://pkgx.sh/VERSION) \
89+
$(/usr/local/bin/pkgx --version | awk '{print $2}') >/dev/null 2>&1
90+
else
8691
return 0
87-
elif [ $(/usr/bin/which pkgx) != /usr/local/bin/pkgx ]; then
88-
# if pkgx is not installed to /usr/local/bin then we’re not getting involved
89-
return 1
9092
fi
91-
92-
# if the installed version is less than the available version then upgrade
93-
pkgx --silent semverator gt \
94-
$(curl -Ssf https://pkgx.sh/VERSION) \
95-
$(/usr/local/bin/pkgx --version | awk '{print $2}') >/dev/null 2>&1
9693
}
9794

9895
########################################################################### meat

0 commit comments

Comments
 (0)