fix(core): update
This commit is contained in:
@ -201,4 +201,25 @@ export class Directory {
|
||||
const path = plugins.path.join(this.getBasePath(), pathArg);
|
||||
await this.bucketRef.fastRemove(path);
|
||||
}
|
||||
|
||||
/**
|
||||
* deletes the directory with all its contents
|
||||
*/
|
||||
public async deleteWithAllContents() {
|
||||
const deleteDirectory = async (directoryArg: Directory) => {
|
||||
const childDirectories = await directoryArg.listDirectories();
|
||||
if (childDirectories.length === 0) {
|
||||
console.log('directory empty! Path complete!');
|
||||
} else {
|
||||
for (const childDir of childDirectories) {
|
||||
await deleteDirectory(childDir);
|
||||
}
|
||||
}
|
||||
const files = await directoryArg.listFiles();
|
||||
for (const file of files) {
|
||||
await directoryArg.fastRemove(file.name);
|
||||
}
|
||||
};
|
||||
await deleteDirectory(this);
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user