Skip to content

Commit

Permalink
output fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
mxcl committed Jan 15, 2025
1 parent d703046 commit be60b09
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 13 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,15 @@
# GitHub Action

```yaml
- uses: pkgxdev/setup@v2
- uses: pkgxdev/setup@v3
```
Installs the latest version of `pkgx`.

See [`action.yml`] for all inputs and outputs, but here’s the usual ones:

```yaml
- uses: pkgxdev/setup@v2
- uses: pkgxdev/setup@v3
with:
+: [email protected]
[email protected] # we understand colloquial names, generally just type what you know
Expand Down
24 changes: 13 additions & 11 deletions installer.sh
Original file line number Diff line number Diff line change
Expand Up @@ -54,20 +54,21 @@ _install_pre_reqs() {

# minimal but required or networking doesn’t work
# https://packages.debian.org/buster/all/netbase/filelist
A=netbase
# ca-certs needed until we bundle our own root cert
A="netbase ca-certificates"

# difficult to pkg in our opinion
B=libudev-dev

case $(cat /etc/debian_version) in
jessie/sid|8.*|stretch/sid|9.*)
apt --yes install libc-dev libstdc++-4.8-dev libgcc-4.7-dev $A $B;;
apt install --yes libc-dev libstdc++-4.8-dev libgcc-4.7-dev $A $B;;
buster/sid|10.*)
apt --yes install libc-dev libstdc++-8-dev libgcc-8-dev $A $B;;
apt install --yes libc-dev libstdc++-8-dev libgcc-8-dev $A $B;;
bullseye/sid|11.*)
apt --yes install libc-dev libstdc++-10-dev libgcc-9-dev $A $B;;
apt install --yes libc-dev libstdc++-10-dev libgcc-9-dev $A $B;;
bookworm/sid|12.*|*)
apt --yes install libc-dev libstdc++-11-dev libgcc-11-dev $A $B;;
apt install --yes libc-dev libstdc++-11-dev libgcc-11-dev $A $B;;
esac
elif test -f /etc/fedora-release; then
$SUDO yum --assumeyes install libatomic
Expand Down Expand Up @@ -129,10 +130,12 @@ _install_pkgx() {
}

_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}')
new_version=$(curl -Ssf https://pkgx.sh/VERSION)
old_version=$(/usr/local/bin/pkgx --version || echo pkgx 0)
old_version=$(echo $old_version | cut -d' ' -f2)
major_version=$(echo $new_version | cut -d. -f1)

/usr/local/bin/pkgx --silent semverator gt $new_version $old_version
}

_should_install_pkgx() {
Expand Down Expand Up @@ -160,8 +163,7 @@ if [ $# -gt 0 ]; then
elif [ $(basename "/$0") != 'installer.sh' ]; then
# ^^ temporary exception for action.ts

if type eval >/dev/null 2>&1; then
# we `type eval` as on Travis there was no `eval`!
if [ $major_version -lt 2 ] && type eval >/dev/null 2>&1; then
eval "$(pkgx --shellcode)" 2>/dev/null
fi

Expand Down

0 comments on commit be60b09

Please sign in to comment.