Add local CLI #144
1 changed files with 6 additions and 2 deletions
Fix deletion logic
commit
d1c4b319a5
|
|
@ -169,12 +169,16 @@ export class FileOperations {
|
||||||
path: RelativePath
|
path: RelativePath
|
||||||
): Promise<void> {
|
): Promise<void> {
|
||||||
let directory = path;
|
let directory = path;
|
||||||
while (directory.length > 1) {
|
// eslint-disable-next-line @typescript-eslint/no-unnecessary-condition
|
||||||
|
while (true) {
|
||||||
[directory] = FileOperations.getParentDirAndFile(directory);
|
[directory] = FileOperations.getParentDirAndFile(directory);
|
||||||
|
if (directory.length === 0) {
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
const remainingContent =
|
const remainingContent =
|
||||||
await this.fs.listFilesRecursively(directory);
|
await this.fs.listFilesRecursively(directory);
|
||||||
if (remainingContent.length == 0) {
|
if (remainingContent.length === 0) {
|
||||||
this.logger.debug(
|
this.logger.debug(
|
||||||
`Folder (${directory}) is now empty, deleting`
|
`Folder (${directory}) is now empty, deleting`
|
||||||
);
|
);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue