Skip to content

Commit 3cbdd70

Browse files
authored
Merge pull request #262 from pkgxdev/fix-double-install
don’t install pkgx@latest as well as selected v
2 parents 84725b0 + 0e3d3ef commit 3cbdd70

File tree

3 files changed

+9
-2
lines changed

3 files changed

+9
-2
lines changed

.github/workflows/ci.action.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@ on:
55
- action.ts
66
- action.yml
77
- package.json
8+
- installer.sh
9+
- .github/workflows/ci.action.yml
810

911
concurrency:
1012
group: ${{ github.ref || 'ci' }}/action.ts
@@ -31,7 +33,7 @@ jobs:
3133
name: dist
3234
path: dist
3335
- uses: ./
34-
- run: pkgx --version
36+
- run: if [[ $(pkgx --version) != "pkgx "1.* ]]; then exit 1; fi
3537

3638
plus-pkgs:
3739
needs: dist

action.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ async function go() {
7272
// use our installer to install any required pre-requisites from the system packager
7373
const installer_script = path.join(path.dirname(__filename), "installer.sh")
7474
if (process.getuid && process.getuid() == 0) {
75-
await exec(installer_script)
75+
await exec(installer_script, [], { env: {...process.env, PKGX_ONLY_INSTALL_PREREQS: '1' } })
7676
} else {
7777
await exec('sudo', [installer_script])
7878
}

installer.sh

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -147,6 +147,11 @@ _should_install_pkgx() {
147147

148148
########################################################################### meat
149149

150+
if [ "$PKGX_ONLY_INSTALL_PREREQS" = 1 ]; then
151+
_install_pre_reqs
152+
exit 0
153+
fi
154+
150155
if _should_install_pkgx; then
151156
_install_pkgx "$@"
152157
elif [ $# -eq 0 ]; then

0 commit comments

Comments
 (0)