From 192f531d204efad5223cbef41df46402aa3aa71a Mon Sep 17 00:00:00 2001 From: "M.Abdulrahman Alnaseer" <20760062+abdalrohman@users.noreply.github.com> Date: Fri, 15 Aug 2025 08:58:42 -0400 Subject: [PATCH] fix(flattener): fix argument parsing logic to work with provided input/output paths The flattener tool had inverted logic that would show an error message when users provided arguments (-i/--input or -o/--output) instead of using them. This fix removes the incorrect error message, allowing the tool to work correctly in both modes: - When arguments are provided: uses the specified paths - When no arguments are provided: works in interactive mode as before --- tools/flattener/main.js | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/tools/flattener/main.js b/tools/flattener/main.js index 5076c552..640c85f6 100644 --- a/tools/flattener/main.js +++ b/tools/flattener/main.js @@ -127,12 +127,9 @@ program path.join(inputDir, "flattened-codebase.xml"), ); } - } else { - console.error( - "Could not auto-detect a project root and no arguments were provided. Please specify -i/--input and -o/--output.", - ); - process.exit(1); } + // If user provided arguments, use the resolved inputDir and outputPath from the options + // which are already set at the beginning of the function // Ensure output directory exists await fs.ensureDir(path.dirname(outputPath));