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 11, 2025
1 parent 5d48260 commit 178a4de
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 4 deletions.
2 changes: 1 addition & 1 deletion action.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ async function go() {
data: prefix.join(".data"),
cache: prefix.join(".cache"),
pantries: [],
UserAgent: 'pkgx.setup/0.1.0', //TODO version
UserAgent: 'pkgx.setup/0.2.0', //TODO version
options: { compression: 'gz' }
})
const { map, flatten } = useShellEnv()
Expand Down
4 changes: 2 additions & 2 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ inputs:
version:
description: >
The version of `pkgx` to install.
Defaults to the @latest.
required: false
Defaults to ^1.
required: ^1
runs:
using: node20
main: dist/out/index.js
6 changes: 5 additions & 1 deletion installer.sh
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,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 @@ -69,10 +69,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 178a4de

Please sign in to comment.