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
This commit is contained in:
M.Abdulrahman Alnaseer 2025-08-15 08:58:42 -04:00
parent 9868437f10
commit 192f531d20
1 changed files with 2 additions and 5 deletions

View File

@ -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));