Skip to content

Commit b0c79ad

Browse files
committed
Install pkgm alongside pkgx
* 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
1 parent 9cf1801 commit b0c79ad

File tree

2 files changed

+7
-8
lines changed

2 files changed

+7
-8
lines changed

README.md

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -32,11 +32,6 @@ $ pkgx +rust
3232
> See [`@pkgxdev/dev`] to run the `dev` command in a GitHub Actions compatible manner
3333

3434

35-
### Shell Integration
36-
37-
We cannot integrate with the GitHub Actions shell. But you probably don’t
38-
need it.
39-
4035
### Should you Cache `~/.pkgx`?
4136

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

5954
## Temporary Sandboxes

installer.sh

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ _install_pkgx() {
117117
progress="--progress-bar"
118118
fi
119119

120-
tmpdir=$(mktemp -d)
120+
tmpdir="$(mktemp -d)"
121121

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

133+
curl --silent --fail --proto '=https' -o "$tmpdir/pkgm" \
134+
https://pkgxdev.github.io/pkgm/pkgm.ts
135+
133136
curl $progress --fail --proto '=https' "https://pkgx.sh/$(uname)/$(uname -m)".tgz > "$pipe" &
134137
$SUDO sh -c "
135138
mkdir -p /usr/local/bin
136139
tar xz --directory /usr/local/bin < '$pipe'
140+
install -m 755 "$tmpdir/pkgm" /usr/local/bin
137141
" &
138142
wait
139143

0 commit comments

Comments
 (0)