mirror of
https://github.com/vrtmrz/obsidian-livesync.git
synced 2026-09-01 16:27:07 +00:00
Fixed:
- Now nested ignore files could be parsed correctly. - The unexpected deletion of hidden files in some cases has been corrected. - Hidden file change is no longer reflected on the device which has made the change itself.
This commit is contained in:
+9
-4
@@ -2569,9 +2569,14 @@ Or if you are sure know what had been happened, we can unlock the database from
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Check the file is ignored by the ignore files.
|
||||
* @param file
|
||||
* @returns true if the file should be ignored, false if the file should be processed.
|
||||
*/
|
||||
async isIgnoredByIgnoreFiles(file: string | TAbstractFile) {
|
||||
if (!this.settings.useIgnoreFiles) {
|
||||
return true;
|
||||
return false;
|
||||
}
|
||||
const filepath = file instanceof TFile ? file.path : file as string;
|
||||
if (this.ignoreFileCache.has(filepath)) {
|
||||
@@ -2579,14 +2584,14 @@ Or if you are sure know what had been happened, we can unlock the database from
|
||||
await this.readIgnoreFile(filepath);
|
||||
}
|
||||
if (!await isAcceptedAll(stripAllPrefixes(filepath as FilePathWithPrefix), this.ignoreFiles, (filename) => this.getIgnoreFile(filename))) {
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
return true;
|
||||
return false;
|
||||
}
|
||||
|
||||
async isTargetFile(file: string | TAbstractFile) {
|
||||
const filepath = file instanceof TFile ? file.path : file as string;
|
||||
if (this.settings.useIgnoreFiles && !await this.isIgnoredByIgnoreFiles(file)) {
|
||||
if (this.settings.useIgnoreFiles && await this.isIgnoredByIgnoreFiles(file)) {
|
||||
return false;
|
||||
}
|
||||
return this.localDatabase.isTargetFile(filepath);
|
||||
|
||||
Reference in New Issue
Block a user