cleobnvntra / genereadme

GENEREADME is a command-line tool that takes in a source code file and generates a README.md file that explains the code in the file by utilizing an LLM.
MIT License
1 stars 1 forks source link

Issue: Generated readme replaces repo's readme file #8

Closed Mounayer closed 1 week ago

Mounayer commented 1 week ago

Description

When I ran the rm-generator generate main.cpp command, the generated README.md file replaced the project's README.md file. Perhaps there should be a functionality that modifies the name of the generated file to something like FILENAME_README.md instead of just README.md.

image

Reproducing The Issue

Fix Suggestion

For now, maybe simply updating the name of the file generated in index.js from:

const outputPath = path.join(fileDir, "README.md");

to

const outputPath = path.join(fileDir, `${file}_README.md`);
cleobnvntra commented 1 week ago

Thank you for catching this.

I wrote the code with the assumption that the user will be passing files from a different directory when using the tool. This also provided me an idea for a possible feature in the future!

Closed this issue with PR: #9