From: Jérôme Benoit Date: Mon, 27 Nov 2023 17:03:22 +0000 (+0100) Subject: fix: use conditional import in prepare.mjs X-Git-Url: https://git.piment-noir.org/?a=commitdiff_plain;h=a0648418a6d7876de055a222685c9a2b43039277;p=benchmarks-js.git fix: use conditional import in prepare.mjs Signed-off-by: Jérôme Benoit --- diff --git a/prepare.mjs b/prepare.mjs index 9a107a6..768ba5b 100644 --- a/prepare.mjs +++ b/prepare.mjs @@ -1,8 +1,13 @@ import { env } from 'node:process' -// eslint-disable-next-line n/no-unpublished-import -import { install } from 'husky' const isCIEnvironment = env.CI != null if (isCIEnvironment === false) { - install() + // eslint-disable-next-line n/no-unpublished-import + import('husky') + .then(({ install }) => { + return install() + }) + .catch(err => { + console.error(err) + }) }