Skip to content

Commit

Permalink
fix PR feedback
Browse files Browse the repository at this point in the history
  • Loading branch information
ErwanRaulo committed Jul 16, 2024
1 parent c80d0ba commit 480b21e
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 8 deletions.
6 changes: 1 addition & 5 deletions bin/commands/execute.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,6 @@ export async function execute(options) {
const config = configResult.unwrap();
const { report } = config;

if (debugMode) {
debug(config, "config");
}

if (report.reporters.length === 0) {
throw new Error("At least one reporter must be selected (either 'HTML' or 'PDF')");
}
Expand All @@ -48,7 +44,7 @@ export async function execute(options) {
debug(data, "pkg-repo");
}

reporting.proceed(data);
return reporting.proceed(data);
})
.catch((error) => {
console.error(error);
Expand Down
6 changes: 3 additions & 3 deletions bin/options/debug.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import path from "node:path";
import { writeFile } from "fs/promises";
import { inspect } from "util";
import { writeFileSync } from "node:fs";
import { inspect } from "node:util";

import * as CONSTANTS from "../../src/constants.js";


export function debug(obj, fileName) {
const filePath = path.join(CONSTANTS.DIRS.REPORTS, `debug-${fileName}.txt`);
writeFile(filePath, inspect(obj, { showHidden: true, depth: null }), "utf8");
writeFileSync(filePath, inspect(obj, { showHidden: true, depth: null }), "utf8");
}

0 comments on commit 480b21e

Please sign in to comment.