Closed mayank-Pareek closed 1 week ago
I have moved the file check logic out of loop hence, the output file will be checked for existent data only once. This change will overwrites any existing content before printing the first response.
I have not removed the warning message completely, however with this change it will be printed only once irrespective of number of input files. Let me know if you still want it to be removed completely.
Description:
This pull request modifies the program to append data to the output file when multiple input files are provided and the
--output
flag is used. Previously, the program would overwrite the output file with each input file’s data. Now, it appends the results from each input to the specified output file.Changes Made:
fs.appendFile
instead offs.writeFile
when multiple input files are passed along with the--output
flag. This ensures that data from all input files is written sequentially to the same output file, rather than overwriting previous content.fs.readFile
for empty check.This fixes #12 , let me know if further changes are required.