mirror of
https://github.com/vrtmrz/obsidian-livesync.git
synced 2025-12-20 21:21:31 +00:00
## 0.24.26
### New Features - Automatic display-language changing according to the Obsidian language setting. - Now we can limit files to be synchronised even in the hidden files. - "Use Request API to avoid `inevitable` CORS problem" has been implemented. - `Show status icon instead of file warnings banner` has been implemented. ### Improved - All regular expressions can be inverted by prefixing `!!` now. ### Fixed - No longer unexpected files will be gathered during hidden file sync. - No longer broken `\n` and new-line characters during the bucket synchronisation. - We can purge the remote bucket again if we using MinIO instead of AWS S3 or Cloudflare R2. - Purging the remote bucket is now more reliable. - Some wrong messages have been fixed. ### Behaviour changed - Entering into the deeper directories to gather the hidden files is now limited by `/` or `\/` prefixed ignore filters. ### Etcetera - Some code has been tidied up. - Trying less warning-suppressing and be more safer-coding. - Dependent libraries have been updated to the latest version. - Some build processes have been separated to `pre` and `post` processes.
This commit is contained in:
@@ -14,7 +14,7 @@ import type {
|
||||
import { TFileToUXFileInfoStub, TFolderToUXFileInfoStub } from "./storageLib/utilObsidian.ts";
|
||||
import { StorageEventManagerObsidian, type StorageEventManager } from "./storageLib/StorageEventManager";
|
||||
import type { StorageAccess } from "../interfaces/StorageAccess";
|
||||
import { createBlob } from "../../lib/src/common/utils";
|
||||
import { createBlob, type CustomRegExp } from "../../lib/src/common/utils";
|
||||
|
||||
export class ModuleFileAccessObsidian extends AbstractObsidianModule implements IObsidianModule, StorageAccess {
|
||||
vaultAccess!: SerializedFileAccess;
|
||||
@@ -223,8 +223,8 @@ export class ModuleFileAccessObsidian extends AbstractObsidianModule implements
|
||||
|
||||
async getFilesIncludeHidden(
|
||||
basePath: string,
|
||||
includeFilter?: RegExp[],
|
||||
excludeFilter?: RegExp[],
|
||||
includeFilter?: CustomRegExp[],
|
||||
excludeFilter?: CustomRegExp[],
|
||||
skipFolder: string[] = [".git", ".trash", "node_modules"]
|
||||
): Promise<FilePath[]> {
|
||||
let w: ListedFiles;
|
||||
@@ -239,16 +239,11 @@ export class ModuleFileAccessObsidian extends AbstractObsidianModule implements
|
||||
|
||||
let files = [] as string[];
|
||||
for (const file of w.files) {
|
||||
if (excludeFilter && excludeFilter.some((ee) => file.match(ee))) {
|
||||
// If excludeFilter and includeFilter are both set, the file will be included in the list.
|
||||
if (includeFilter) {
|
||||
if (!includeFilter.some((e) => file.match(e))) continue;
|
||||
} else {
|
||||
continue;
|
||||
}
|
||||
if (includeFilter && includeFilter.length > 0) {
|
||||
if (!includeFilter.some((e) => e.test(file))) continue;
|
||||
}
|
||||
if (includeFilter) {
|
||||
if (!includeFilter.some((e) => file.match(e))) continue;
|
||||
if (excludeFilter && excludeFilter.some((ee) => ee.test(file))) {
|
||||
continue;
|
||||
}
|
||||
if (await this.plugin.$$isIgnoredByIgnoreFiles(file)) continue;
|
||||
files.push(file);
|
||||
@@ -259,16 +254,12 @@ export class ModuleFileAccessObsidian extends AbstractObsidianModule implements
|
||||
if (skipFolder.some((e) => folderName === e)) {
|
||||
continue;
|
||||
}
|
||||
if (excludeFilter && excludeFilter.some((e) => v.match(e))) {
|
||||
if (includeFilter) {
|
||||
if (!includeFilter.some((e) => v.match(e))) {
|
||||
continue;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (includeFilter) {
|
||||
if (!includeFilter.some((e) => v.match(e))) continue;
|
||||
if (excludeFilter && excludeFilter.some((e) => e.test(v))) {
|
||||
continue;
|
||||
}
|
||||
if (await this.plugin.$$isIgnoredByIgnoreFiles(v)) {
|
||||
continue;
|
||||
}
|
||||
// OK, deep dive!
|
||||
files = files.concat(await this.getFilesIncludeHidden(v, includeFilter, excludeFilter, skipFolder));
|
||||
|
||||
Reference in New Issue
Block a user