From abbda0d66a7393db295280234057a2bb371346c2 Mon Sep 17 00:00:00 2001 From: Animesh Kumar Date: Sun, 24 Mar 2024 20:01:20 +0530 Subject: [PATCH] fix: insert `process.exit(1)` at correct place Changes: - applied suggestion from: https://github.com/asyncapi/spec/pull/1046/files?diff=unified&w=0#r1535456030 --- scripts/validation/validate-examples.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/scripts/validation/validate-examples.js b/scripts/validation/validate-examples.js index 9513a98f..0e9a6f65 100644 --- a/scripts/validation/validate-examples.js +++ b/scripts/validation/validate-examples.js @@ -17,7 +17,6 @@ files.forEach((file) => { console.error(`Validation failed for: ${file}\n`); errorFilesCount++; filesWithErrors.push(file); - // process.exit(1); } }); @@ -30,6 +29,8 @@ if (filesWithErrors.length > 0) { filesWithErrors.forEach((file) => { console.log(file); }); + process.exit(1); } else { console.log('\nAll files validated successfully.'); + process.exit(1); } \ No newline at end of file