mirror of
https://github.com/vrtmrz/obsidian-livesync.git
synced 2026-07-24 21:42:58 +00:00
fix: synchronise case-only file renames safely
This commit is contained in:
@@ -103,6 +103,13 @@ export class NodeVaultAdapter implements IVaultAdapter<NodeFile> {
|
||||
};
|
||||
}
|
||||
|
||||
async rename(file: NodeFile, newPath: string): Promise<void> {
|
||||
const targetPath = this.resolvePath(newPath);
|
||||
await fs.mkdir(path.dirname(targetPath), { recursive: true });
|
||||
await fs.rename(this.resolvePath(file.path), targetPath);
|
||||
file.path = newPath as FilePath;
|
||||
}
|
||||
|
||||
async delete(file: NodeFile | NodeFolder, force = false): Promise<void> {
|
||||
const fullPath = this.resolvePath(file.path);
|
||||
const stat = await fs.stat(fullPath);
|
||||
|
||||
Reference in New Issue
Block a user