Skip to content

Commit 757d485

Browse files
tps-anviltps-flint
authored andcommitted
fix: make postinstall CJS and skip in CI
1 parent 60627ff commit 757d485

2 files changed

Lines changed: 12 additions & 1 deletion

File tree

packages/cli/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
"lint:ci": "biome lint ./src ./bin --max-diagnostics=200",
2727
"pretest": "tsc",
2828
"test": "bun test",
29-
"postinstall": "node scripts/postinstall.js"
29+
"postinstall": "node scripts/postinstall.cjs"
3030
},
3131
"keywords": [
3232
"cli",
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
if (process.env.CI) process.exit(0);
2+
const { execSync } = require("child_process");
3+
const { arch, platform } = process;
4+
const pkg = `@tpsdev-ai/cli-${platform}-${arch}`;
5+
const version = require("../package.json").version;
6+
7+
try {
8+
execSync(`npm install -g ${pkg}@${version}`, { stdio: "inherit" });
9+
} catch {
10+
console.warn(`Optional: install ${pkg}@${version} for native binary performance.`);
11+
}

0 commit comments

Comments
 (0)