Skip to content

Commit 07243f5

Browse files
committed
fix and tweak update check
1 parent 3dd7208 commit 07243f5

1 file changed

Lines changed: 7 additions & 5 deletions

File tree

installer.sh

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -96,11 +96,13 @@ _install_pkgx() {
9696
_should_install_pkgx() {
9797
if [ ! -f /usr/local/bin/pkgx ]; then
9898
return 0
99+
elif /usr/local/bin/pkgx --silent semverator gt \
100+
$(curl -Ssf https://pkgx.sh/VERSION) \
101+
$(/usr/local/bin/pkgx --version | awk '{print $2}') >/dev/null 2>&1
102+
then
103+
return 0
99104
else
100-
# if the installed version is less than the available version then upgrade
101-
/usr/local/bin/pkgx --silent semverator gt \
102-
$(curl -Ssf https://pkgx.sh/VERSION) \
103-
$(/usr/local/bin/pkgx --version | awk '{print $2}') >/dev/null 2>&1
105+
return 1
104106
fi
105107
}
106108

@@ -109,7 +111,7 @@ _should_install_pkgx() {
109111
if _should_install_pkgx; then
110112
_install_pkgx "$@"
111113
elif [ $# -eq 0 ]; then
112-
echo "pkgx already up-to-date" >&2
114+
echo "$(pkgx --version) already installed" >&2
113115
fi
114116

115117
if _is_ci; then

0 commit comments

Comments
 (0)