Skip to content

Commit f9e93f0

Browse files
committed
fix(ci): correct preinstall skip logic for CI
The original `||`-chained preinstall printed "Skipping preinstall..." in CI but then ran only-allow anyway because `process.exit(1)` triggers the `||` operator. CI happened to pass when only-allow was unpinned (npx resolved it differently), but pinning to @1.2.2 forced a fresh registry resolve in which only-allow strictly checks npm_config_user_agent — which, when invoked via npx-inside-pnpm, is npm's, not pnpm's — and rejects. The fix matches the script's stated intent: when CI=true, exit 0 so the `||` does not trigger and only-allow is genuinely skipped. Local installs continue to fall through and enforce pnpm via only-allow as before.
1 parent 4bea0d3 commit f9e93f0

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
"generate-docs": "node scripts/generate-docs.ts",
2323
"lint:fix": "nx affected --target=lint:fix --exclude=examples/**",
2424
"lint:fix:all": "pnpm run format && nx run-many --targets=lint --fix",
25-
"preinstall": "node -e \"if(process.env.CI == 'true') {console.log('Skipping preinstall...'); process.exit(1)}\" || npx -y only-allow@1.2.2 pnpm",
25+
"preinstall": "node -e \"if(process.env.CI === 'true') { console.log('Skipping preinstall...'); process.exit(0); } process.exit(1);\" || npx -y only-allow@1.2.2 pnpm",
2626
"size": "size-limit",
2727
"test": "pnpm run test:ci",
2828
"test:build": "nx affected --target=test:build --exclude=examples/**",

0 commit comments

Comments
 (0)