From 0e3d3ef482c0475d7987307f3a70fbff3a1bbf12 Mon Sep 17 00:00:00 2001 From: Max Howell Date: Wed, 15 Jan 2025 13:05:45 -0500 Subject: [PATCH] =?UTF-8?q?Don=E2=80=99t=20install=20pkgx@latest=20as=20we?= =?UTF-8?q?ll=20as=20selected=20v?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fixes https://github.com/pkgxdev/dev/issues/12 --- .github/workflows/ci.action.yml | 4 +++- action.ts | 2 +- installer.sh | 5 +++++ 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.action.yml b/.github/workflows/ci.action.yml index a5691bdf..2d8733f2 100644 --- a/.github/workflows/ci.action.yml +++ b/.github/workflows/ci.action.yml @@ -5,6 +5,8 @@ on: - action.ts - action.yml - package.json + - installer.sh + - .github/workflows/ci.action.yml concurrency: group: ${{ github.ref || 'ci' }}/action.ts @@ -31,7 +33,7 @@ jobs: name: dist path: dist - uses: ./ - - run: pkgx --version + - run: if [[ $(pkgx --version) != "pkgx "1.* ]]; then exit 1; fi plus-pkgs: needs: dist diff --git a/action.ts b/action.ts index 454ffb3b..50098160 100644 --- a/action.ts +++ b/action.ts @@ -72,7 +72,7 @@ async function go() { // use our installer to install any required pre-requisites from the system packager const installer_script = path.join(path.dirname(__filename), "installer.sh") if (process.getuid && process.getuid() == 0) { - await exec(installer_script) + await exec(installer_script, [], { env: {...process.env, PKGX_ONLY_INSTALL_PREREQS: '1' } }) } else { await exec('sudo', [installer_script]) } diff --git a/installer.sh b/installer.sh index 6ff353de..e0a71758 100755 --- a/installer.sh +++ b/installer.sh @@ -147,6 +147,11 @@ _should_install_pkgx() { ########################################################################### meat +if [ "$PKGX_ONLY_INSTALL_PREREQS" = 1 ]; then + _install_pre_reqs + exit 0 +fi + if _should_install_pkgx; then _install_pkgx "$@" elif [ $# -eq 0 ]; then