From 480b21e3e71e93fb9360f4a7a2a207bc16699fc1 Mon Sep 17 00:00:00 2001 From: Erwan Date: Wed, 17 Jul 2024 00:01:55 +0200 Subject: [PATCH] fix PR feedback --- bin/commands/execute.js | 6 +----- bin/options/debug.js | 6 +++--- 2 files changed, 4 insertions(+), 8 deletions(-) diff --git a/bin/commands/execute.js b/bin/commands/execute.js index bd3e75f..591ef04 100644 --- a/bin/commands/execute.js +++ b/bin/commands/execute.js @@ -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')"); } @@ -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); diff --git a/bin/options/debug.js b/bin/options/debug.js index 0daa341..72372f1 100644 --- a/bin/options/debug.js +++ b/bin/options/debug.js @@ -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"); }