This commit is contained in:
Andras Schmelczer 2025-11-23 20:27:16 +00:00
commit 18be9f4dd8

View file

@ -25,7 +25,7 @@ export class FileOperations {
): [RelativePath, RelativePath] {
const pathParts = path.split("/");
const fileName = pathParts.pop();
if (!fileName || fileName === "") {
if (fileName == null || fileName === "") {
throw new Error(`Path '${path}' cannot be empty`);
}
@ -166,6 +166,10 @@ export class FileOperations {
await this.deletingEmptyParentDirectoriesOfDeletedFile(oldPath);
}
public reset(): void {
this.fs.reset();
}
private async deletingEmptyParentDirectoriesOfDeletedFile(
path: RelativePath
): Promise<void> {
@ -254,8 +258,4 @@ export class FileOperations {
return newName;
}
public reset(): void {
this.fs.reset();
}
}