Skip to content

Commit

Permalink
fix: log coverage error
Browse files Browse the repository at this point in the history
  • Loading branch information
sakulstra committed Nov 14, 2024
1 parent ce448eb commit a75d07a
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 3 deletions.
8 changes: 7 additions & 1 deletion dist/action.js
Original file line number Diff line number Diff line change
Expand Up @@ -24144,7 +24144,13 @@ var root = (0, import_core.getInput)("ROOT_REPORT_PATH");
var current = (0, import_core.getInput)("REPORT_PATH");
var command = (0, import_core.getInput)("COVERAGE_COMMAND");
if (command && command != "false") {
(0, import_child_process.execSync)(command);
try {
(0, import_child_process.execSync)(command);
} catch (err) {
console.log("output", err);
console.log("sdterr", err.stderr.toString());
process.exit(1);
}
}
var rootExists = root && (0, import_fs.existsSync)(root);
var currentExists = current && (0, import_fs.existsSync)(current);
Expand Down
8 changes: 7 additions & 1 deletion dist/action.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -24149,7 +24149,13 @@ var root = (0, import_core.getInput)("ROOT_REPORT_PATH");
var current = (0, import_core.getInput)("REPORT_PATH");
var command = (0, import_core.getInput)("COVERAGE_COMMAND");
if (command && command != "false") {
execSync(command);
try {
execSync(command);
} catch (err) {
console.log("output", err);
console.log("sdterr", err.stderr.toString());
process.exit(1);
}
}
var rootExists = root && existsSync(root);
var currentExists = current && existsSync(current);
Expand Down
8 changes: 7 additions & 1 deletion src/action.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,13 @@ const current = getInput("REPORT_PATH");
const command = getInput("COVERAGE_COMMAND");

if (command && command != "false") {
execSync(command);
try {
execSync(command);
} catch (err) {
console.log("output", err);
console.log("sdterr", (err as any).stderr.toString());
process.exit(1);
}
}

const rootExists = root && existsSync(root);
Expand Down

0 comments on commit a75d07a

Please sign in to comment.