Skip to content

Commit

Permalink
fix: prevent husky install script on production
Browse files Browse the repository at this point in the history
  • Loading branch information
mohitb35 committed Jan 25, 2023
1 parent 32636dd commit c140701
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
6 changes: 6 additions & 0 deletions husky-prepare.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
const isDev = process.env.NODE_ENV !== 'production';

if (isDev) {
console.log('Setting up husky on dev environment');
require('husky').install();
}
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
"storybook": "start-storybook -p 6006",
"build-storybook": "build-storybook",
"chromatic": "npx chromatic --exit-zero-on-changes",
"prepare": "husky install"
"prepare": "node ./husky-prepare.js"
},
"validate-branch-name": {
"pattern": "^(main|develop){1}$|^(feature|hotfix)/[a-z0-9-_]+$",
Expand Down

0 comments on commit c140701

Please sign in to comment.