Fix file moves
This commit is contained in:
parent
2acd02b67e
commit
e6ffe8cbdc
1 changed files with 6 additions and 4 deletions
|
|
@ -116,15 +116,17 @@ export class ObsidianFileOperations implements FileOperations {
|
||||||
oldPath: RelativePath,
|
oldPath: RelativePath,
|
||||||
newPath: RelativePath
|
newPath: RelativePath
|
||||||
): Promise<void> {
|
): Promise<void> {
|
||||||
|
oldPath = normalizePath(oldPath);
|
||||||
|
newPath = normalizePath(newPath);
|
||||||
|
|
||||||
Logger.getInstance().debug(`Moving file: ${oldPath} -> ${newPath}`);
|
Logger.getInstance().debug(`Moving file: ${oldPath} -> ${newPath}`);
|
||||||
|
|
||||||
if (oldPath === newPath) {
|
if (oldPath === newPath) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
await this.vault.adapter.rename(
|
await this.createParentDirectories(newPath);
|
||||||
normalizePath(oldPath),
|
await this.vault.adapter.rename(oldPath, newPath);
|
||||||
normalizePath(newPath)
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public isFileEligibleForSync(path: RelativePath): boolean {
|
public isFileEligibleForSync(path: RelativePath): boolean {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue