Skip to content

Commit

Permalink
fix: use js postinstall hook
Browse files Browse the repository at this point in the history
Signed-off-by: Chapman Pendery <[email protected]>
  • Loading branch information
cpendery committed Nov 3, 2024
1 parent 8a787aa commit 348e43f
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
6 changes: 6 additions & 0 deletions .scripts/postinstall.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
import fs from "node:fs";

if (fs.existsSync("./build/commands/init.js")) {
const init = (await import("../build/commands/init.js")).default;
init.parse(["--generate-full-configs"], { from: "user" });
}
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
"lint:fix": "eslint src/ --ext .ts,.tsx --fix && prettier src/ --write",
"debug": "node --inspect --import=tsx src/index.ts -V",
"pre-commit": "lint-staged",
"postinstall": "node ./build/index.js init --generate-full-configs"
"postinstall": "node ./.scripts/postinstall.js"
},
"repository": {
"type": "git",
Expand Down

0 comments on commit 348e43f

Please sign in to comment.