Delete empty folders during syncing

This commit is contained in:
Andras Schmelczer 2025-10-19 16:10:41 +01:00
commit 116661c674
8 changed files with 64 additions and 20 deletions

View file

@ -14,10 +14,12 @@ export class ObsidianFileSystemOperations implements FileSystemOperations {
private readonly workspace: Workspace
) {}
public async listAllFiles(): Promise<RelativePath[]> {
public async listFilesRecursively(
root: RelativePath | undefined
): Promise<RelativePath[]> {
// Let's implement this by hand because vault.adapter.listAllFiles doesn't always return all files.
const allFiles = [];
const remainingFolders = [this.vault.getRoot().path];
const remainingFolders = [root ?? this.vault.getRoot().path];
// eslint-disable-next-line @typescript-eslint/no-unnecessary-condition
while (true) {