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 30, 2023
1 parent 6a89747 commit fcd6b7a
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 @@ -10,7 +10,7 @@
"lint:errors": "eslint pages src --quiet",
"cypress:open": "cypress open",
"cypress:run": "cypress run",
"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 fcd6b7a

Please sign in to comment.