Skip to content

Commit

Permalink
refactor: fs.mkdir error handler
Browse files Browse the repository at this point in the history
  • Loading branch information
balaji-sivasakthi committed Jul 30, 2023
1 parent 3b7c491 commit 109729b
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions prepare.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,13 @@ const prepareHusky = () => {
const huskyInstallStatus = runCommand("npx", ["husky", "install"]);

// Check if .husky directory exists, if not, create it
if (!fs.existsSync(".husky")) {
fs.mkdirSync(".husky");
}
fs.mkdir(".husky", (err) => {
if (err) {
console.error(err);
} else {
console.log(".husky directory created successfully!");
}
});

// Set permissions for husky on macOS/Linux
if (os.platform() !== "win32") {
Expand Down

0 comments on commit 109729b

Please sign in to comment.