@beuluis/hook-cli
Advanced tools
Comparing version 1.1.0 to 1.1.1
@@ -134,3 +134,3 @@ "use strict"; | ||
task.title = `Found ${console_log_colors_1.color.red(auditCount)} level ${console_log_colors_1.color.bgRed(auditLevel)} or higher vulnerabilities. Run '${console_log_colors_1.color.cyan(`${auditCommandBuilder(packageManager, prod)}`)}' for more information`; | ||
throw new Error(); | ||
throw new commandModule_helper_1.HookFailedError(); | ||
} | ||
@@ -147,4 +147,4 @@ task.title = `Found ${console_log_colors_1.color.cyan(auditCount)} vulnerabilities of lower level then ${console_log_colors_1.color.cyan(auditLevel)}`; | ||
.then(() => process.exit(0)) | ||
.catch(() => { | ||
if (noFail) { | ||
.catch((e) => { | ||
if (e instanceof commandModule_helper_1.HookFailedError && noFail) { | ||
process.exit(0); | ||
@@ -151,0 +151,0 @@ } |
@@ -97,3 +97,3 @@ "use strict"; | ||
task.title = `Found ${console_log_colors_1.color.red(outdatedList.length)} packages to update:`; | ||
throw new Error(); | ||
throw new commandModule_helper_1.HookFailedError(); | ||
} | ||
@@ -119,6 +119,9 @@ throw new Error('Unknown error'); | ||
} | ||
if (fail) { | ||
process.exit(1); | ||
if (e instanceof commandModule_helper_1.HookFailedError) { | ||
if (fail) { | ||
process.exit(1); | ||
} | ||
process.exit(0); | ||
} | ||
process.exit(0); | ||
process.exit(1); | ||
}); | ||
@@ -125,0 +128,0 @@ }, |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.registerCommandModule = void 0; | ||
exports.HookFailedError = exports.registerCommandModule = void 0; | ||
// Helper function to make use of inherited types | ||
@@ -9,2 +9,7 @@ const registerCommandModule = ( | ||
exports.registerCommandModule = registerCommandModule; | ||
// custom error instance to throw errors that can be ignored by options as fail or no-fail | ||
class HookFailedError extends Error { | ||
} | ||
exports.HookFailedError = HookFailedError; | ||
; | ||
//# sourceMappingURL=commandModule.helper.js.map |
{ | ||
"name": "@beuluis/hook-cli", | ||
"version": "1.1.0", | ||
"version": "1.1.1", | ||
"description": "A small hook cli that can be used with for example husky", | ||
@@ -5,0 +5,0 @@ "bin": { |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
67273
376