uday-rana / codeshift

A command-line tool that translates source code files into a chosen programming language.
MIT License
5 stars 4 forks source link

Replace writeFile with appendFile for file output #13

Closed mayank-Pareek closed 1 week ago

mayank-Pareek commented 1 week ago

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:

This fixes #12 , let me know if further changes are required.

mayank-Pareek commented 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.