Skip to content

Commit

Permalink
Allow me to update unversioned dev builds
Browse files Browse the repository at this point in the history
  • Loading branch information
mxcl committed Nov 15, 2023
1 parent 5b6c63a commit 178cedd
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions installer.sh
Original file line number Diff line number Diff line change
Expand Up @@ -93,13 +93,17 @@ _install_pkgx() {
unset tmpdir pipe
}

_pkgx_is_old() {
v="$(/usr/local/bin/pkgx --version || echo pkgx 0)"
/usr/local/bin/pkgx --silent semverator gt \
$(curl -Ssf https://pkgx.sh/VERSION) \
$(echo $v | awk '{print $2}')
}

_should_install_pkgx() {
if [ ! -f /usr/local/bin/pkgx ]; then
return 0
elif /usr/local/bin/pkgx --silent semverator gt \
$(curl -Ssf https://pkgx.sh/VERSION) \
$(/usr/local/bin/pkgx --version | awk '{print $2}') >/dev/null 2>&1
then
elif _pkgx_is_old >/dev/null 2>&1; then
return 0
else
return 1
Expand Down

0 comments on commit 178cedd

Please sign in to comment.