diff --git a/src/apps/cli/managers/CLIStorageEventManagerAdapter.ts b/src/apps/cli/managers/CLIStorageEventManagerAdapter.ts index c2f11e1..f6bc9e0 100644 --- a/src/apps/cli/managers/CLIStorageEventManagerAdapter.ts +++ b/src/apps/cli/managers/CLIStorageEventManagerAdapter.ts @@ -105,7 +105,7 @@ class CLIWatchAdapter implements IStorageEventWatchAdapter { private _toNodeFile(filePath: string, stats: Stats | undefined): NodeFile { return { - path: path.relative(this.basePath, filePath) as FilePath, + path: path.relative(this.basePath, filePath).replace(/\\/g, "/") as FilePath, stat: { ctime: stats?.ctimeMs ?? Date.now(), mtime: stats?.mtimeMs ?? Date.now(), @@ -117,7 +117,7 @@ class CLIWatchAdapter implements IStorageEventWatchAdapter { private _toNodeFolder(dirPath: string): NodeFolder { return { - path: path.relative(this.basePath, dirPath) as FilePath, + path: path.relative(this.basePath, dirPath).replace(/\\/g, "/") as FilePath, isFolder: true, }; } diff --git a/src/apps/cli/managers/CLIStorageEventManagerAdapter.unit.spec.ts b/src/apps/cli/managers/CLIStorageEventManagerAdapter.unit.spec.ts index f646b33..5af69a9 100644 --- a/src/apps/cli/managers/CLIStorageEventManagerAdapter.unit.spec.ts +++ b/src/apps/cli/managers/CLIStorageEventManagerAdapter.unit.spec.ts @@ -80,9 +80,7 @@ describe("CLIStorageEventManagerAdapter", () => { expect(handlers.onCreate).toHaveBeenCalledTimes(1); const created = (handlers.onCreate as ReturnType).mock.calls[0][0] as NodeFile; - if (process.platform !== "win32") { - expect(created.path).toBe("subdir/note.md"); - } + expect(created.path).toBe("subdir/note.md"); expect(created.stat?.size).toBe(42); });