From 6c9eee30a16635576d246836a8fb82af31324929 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukaszNowakPL?= Date: Mon, 17 Jun 2024 22:15:20 +0200 Subject: [PATCH] fix: Run husky on non-CI env only --- .husky/install.mjs | 6 ++++++ package.json | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) create mode 100644 .husky/install.mjs diff --git a/.husky/install.mjs b/.husky/install.mjs new file mode 100644 index 0000000..8bbc81a --- /dev/null +++ b/.husky/install.mjs @@ -0,0 +1,6 @@ +// Skip Husky install in CI +if (process.env.CI === 'true') { + process.exit(0); +} +const husky = (await import('husky')).default; +husky(); diff --git a/package.json b/package.json index 5b19ea9..47f67d9 100644 --- a/package.json +++ b/package.json @@ -21,7 +21,7 @@ "build": "tsc -p tsconfig.json", "release": "semantic-release", "test": "jest", - "prepare": "husky" + "prepare": "node .husky/install.mjs" }, "dependencies": { "glob": "^7.1.6",