ykdojo / kaguya

A ChatGPT plugin that allows you to load and edit your local files in a controlled way, as well as run any Python, JavaScript, and bash script.
http://kaguya.ai/
MIT License
1.2k stars 192 forks source link

Error in deleteDirectory syntax #31

Closed wonderwhy-er closed 11 months ago

wonderwhy-er commented 12 months ago

There is an error here https://github.com/ykdojo/kaguya/blob/master/pages/api/deleteDirectory.js#L5

It tries to modify directoryPath right in parameters I guess ChatGPT wrote that :D

I just changed it from to

function deleteDirectoryRecursively(path.join(process.cwd(), 'FILES', directoryPath)) {

to

function deleteDirectoryRecursively(directoryPath) {
  directoryPath = path.join(process.cwd(), 'FILES', req.query.directoryPath);
ykdojo commented 12 months ago

This commit should've fixed it - let me know if it doesn't work.

ty for raising this issue!