mirror of
https://github.com/vrtmrz/obsidian-livesync.git
synced 2026-11-06 16:28:18 +00:00
Preserve valid files beside unsupported Legacy CLI names
This commit is contained in:
1 parent
bf2241e5ee
commit
165944fe65
2 files changed
+13
-2
No files matched your search
@@ -251,9 +251,9 @@ export class NodeFileSystemAdapter implements IFileSystemAdapter<NodeFile, NodeF
|
||||
const entries = await this.storage.list(relativePath, false);
|
||||
|
||||
for (const entryPath of entries.files) {
|
||||
const filePath = parseFilePath(entryPath);
|
||||
const stat = await this.storage.stat(filePath, false);
|
||||
const stat = await this.storage.stat(entryPath, false);
|
||||
if (stat?.type !== "file") continue;
|
||||
const filePath = parseFilePath(entryPath);
|
||||
const file: NodeFile = {
|
||||
path: filePath,
|
||||
stat,
|
||||
|
||||
@@ -51,6 +51,17 @@ describe("NodeFileSystemAdapter file enumeration", () => {
|
||||
expect((await adapter.getFiles()).map((file) => file.path).sort()).toEqual(paths);
|
||||
});
|
||||
|
||||
it.skipIf(process.platform === "win32")(
|
||||
"compatibility: lists other files in Legacy mode when one root name is unsupported",
|
||||
async () => {
|
||||
const { directory, adapter } = await createVault();
|
||||
await fs.writeFile(path.join(directory, "a:unrelated.md"), "unrelated local bytes");
|
||||
|
||||
expect((await adapter.getFiles()).map((file) => file.path).sort()).toEqual(paths);
|
||||
expect(await fs.readFile(path.join(directory, "a:unrelated.md"), "utf8")).toBe("unrelated local bytes");
|
||||
}
|
||||
);
|
||||
|
||||
it("excludes a deleted file after its cache entry is refreshed", async () => {
|
||||
const { directory, adapter } = await createVault();
|
||||
await adapter.getFiles();
|
||||
|
||||
Reference in new issue
Block a user