fix: fix cf push by conditionnaly importing husky
authorJérôme Benoit <jerome.benoit@sap.com>
Mon, 27 Nov 2023 17:04:35 +0000 (18:04 +0100)
committerJérôme Benoit <jerome.benoit@sap.com>
Mon, 27 Nov 2023 17:04:35 +0000 (18:04 +0100)
Signed-off-by: Jérôme Benoit <jerome.benoit@sap.com>
prepare.js

index 8c299a6214bb5ff469ebc0d1cdf205829281f845..f5d0105495315157b501ee8e41e491b9ba1ea203 100644 (file)
@@ -1,10 +1,8 @@
 import { env } from 'node:process';
 
-// eslint-disable-next-line n/no-unpublished-import
-import { install } from 'husky';
-
 const isCIEnvironment = env.CI !== undefined;
 const isCFEnvironment = env.VCAP_APPLICATION !== undefined;
 if (isCFEnvironment === false && isCIEnvironment === false) {
-  install();
+  // eslint-disable-next-line n/no-unpublished-import
+  import('husky').then(({ install }) => install());
 }