Skip to content

Commit

Permalink
Install pkgm alongside pkgx
Browse files Browse the repository at this point in the history
* Not a complete implementation since we need to check if there’s a newer pkgm separate to pkgx.
* Default action to install pkgx^1 by default since we need a major version bump to switch to ^2
  • Loading branch information
mxcl committed Jan 15, 2025
1 parent 8dd3c8d commit 7677931
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 8 deletions.
9 changes: 2 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,6 @@ $ pkgx +rust
> See [`@pkgxdev/dev`] to run the `dev` command in a GitHub Actions compatible manner


### Shell Integration

We cannot integrate with the GitHub Actions shell. But you probably don’t
need it.

### Should you Cache `~/.pkgx`?

No. pkgx packages are just tarballs. Caching is just a tarball. You’ll likely
Expand All @@ -52,8 +47,8 @@ To install `pkgx`:
```sh
$ curl https://pkgx.sh | sh
# - installs to `/usr/local/bin/pkgx`
# - if pkgx is already installed it’s a noop
# - installs `pkgx` & `pkgm` to `/usr/local/bin`
# - if both are already installed, does an update check
```

## Temporary Sandboxes
Expand Down
6 changes: 5 additions & 1 deletion installer.sh
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ _install_pkgx() {
progress="--progress-bar"
fi

tmpdir=$(mktemp -d)
tmpdir="$(mktemp -d)"

if [ $# -eq 0 ]; then
if [ -f /usr/local/bin/pkgx ]; then
Expand All @@ -130,10 +130,14 @@ _install_pkgx() {
pipe="$tmpdir/pipe"
mkfifo "$pipe"

curl --silent --fail --proto '=https' -o "$tmpdir/pkgm" \
https://pkgxdev.github.io/pkgm/pkgm.ts

curl $progress --fail --proto '=https' "https://pkgx.sh/$(uname)/$(uname -m)".tgz > "$pipe" &
$SUDO sh -c "
mkdir -p /usr/local/bin
tar xz --directory /usr/local/bin < '$pipe'
install -m 755 "$tmpdir/pkgm" /usr/local/bin
" &
wait

Expand Down

0 comments on commit 7677931

Please sign in to comment.