Skip to content

Commit

Permalink
chore: fixed husky run in CI
Browse files Browse the repository at this point in the history
  • Loading branch information
l0r1s committed Apr 18, 2023
1 parent 3a92a7d commit 16d0caf
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
11 changes: 11 additions & 0 deletions javascript/.husky/post-install.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
const isCi = process.env.CI !== undefined;

if (!isCi) {
try {
require("husky").install();
} catch (e) {
if (e.code !== "MODULE_NOT_FOUND") {
throw e;
}
}
}
2 changes: 1 addition & 1 deletion javascript/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
"package:macos": "npm run -w packages/cli package:macos",
"zombie": "node ./packages/cli/dist/cli.js",
"test": "npm run test --workspaces --if-present",
"postinstall": "cd .. && husky install javascript/.husky"
"postinstall": "cd .. && node javascript/.husky/post-install.js"
},
"engines": {
"node": ">=18"
Expand Down

0 comments on commit 16d0caf

Please sign in to comment.