Fix file moves

This commit is contained in:
Andras Schmelczer 2025-01-12 11:34:40 +00:00
parent 2acd02b67e
commit e6ffe8cbdc
No known key found for this signature in database
GPG key ID: FC8F2C3D3D1A718C

View file

@ -116,15 +116,17 @@ export class ObsidianFileOperations implements FileOperations {
oldPath: RelativePath,
newPath: RelativePath
): Promise<void> {
oldPath = normalizePath(oldPath);
newPath = normalizePath(newPath);
Logger.getInstance().debug(`Moving file: ${oldPath} -> ${newPath}`);
if (oldPath === newPath) {
return;
}
await this.vault.adapter.rename(
normalizePath(oldPath),
normalizePath(newPath)
);
await this.createParentDirectories(newPath);
await this.vault.adapter.rename(oldPath, newPath);
}
public isFileEligibleForSync(path: RelativePath): boolean {