Skip to content

Commit b0a23ed

Browse files
committed
feat: discern directories for ignore
1 parent 8a59d1f commit b0a23ed

File tree

5 files changed

+15
-4
lines changed

5 files changed

+15
-4
lines changed

package-lock.json

+2-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@filen/sync",
3-
"version": "0.1.94",
3+
"version": "0.1.95",
44
"description": "Filen Sync",
55
"main": "dist/index.js",
66
"types": "dist/index.d.ts",

src/lib/deltas.ts

+10-1
Original file line numberDiff line numberDiff line change
@@ -494,7 +494,16 @@ export class Deltas {
494494
.sort((a, b) => a.path.split("/").length - b.path.split("/").length)
495495
// Filter by ignored paths
496496
.filter(delta => {
497-
const trailingSlash = delta.type.endsWith("Directory") ? "/" : ""
497+
const trailingSlash =
498+
delta.type === "renameLocalDirectory" ||
499+
delta.type === "createLocalDirectory" ||
500+
delta.type === "createRemoteDirectory" ||
501+
delta.type === "deleteLocalDirectory" ||
502+
delta.type === "renameRemoteDirectory" ||
503+
delta.type === "deleteRemoteDirectory"
504+
? "/"
505+
: ""
506+
498507
if (
499508
delta.type === "renameLocalDirectory" ||
500509
delta.type === "renameLocalFile" ||

src/lib/filesystems/local.ts

+1
Original file line numberDiff line numberDiff line change
@@ -188,6 +188,7 @@ export class LocalFileSystem {
188188
}
189189

190190
const trailingSlash = type === "directory" ? "/" : ""
191+
191192
if (this.sync.ignorer.ignores(relativePath + trailingSlash)) {
192193
this.ignoredCache.set(relativePath, {
193194
ignored: true,

src/lib/filesystems/remote.ts

+1
Original file line numberDiff line numberDiff line change
@@ -185,6 +185,7 @@ export class RemoteFileSystem {
185185
}
186186

187187
const trailingSlash = type === "directory" ? "/" : ""
188+
188189
if (this.sync.ignorer.ignores(relativePath + trailingSlash)) {
189190
this.ignoredCache.set(key, {
190191
ignored: true,

0 commit comments

Comments
 (0)