[Bug report] entry.delete()


#1

From the docs:

entry.delete()
Removes this entry from the file system. If the entry is a folder, all the contents will also be removed

My code:

try{
    await entry.delete();
}catch(e){
    console.log(e);
}

Error:

[Error: Delete on non-empty folder not allowed]

I’m trying to delete a non empty folder according to the docs, but seems that you can’t.


#2

Looks like the docs are in error here; you first have to remove the entries within the directory first, before removing the entry. Thanks for the catch; we’ll update the docs!


#3

Yes this was my solution, I removed the entry first with folder.getEntries() and then the folder itself.
Thanks