Add simple glob ignore patterns
This commit is contained in:
parent
bbb2adce63
commit
ceb217cda8
8 changed files with 95 additions and 8 deletions
|
|
@ -253,6 +253,29 @@ export class SyncSettingsTab extends PluginSettingTab {
|
|||
)
|
||||
);
|
||||
|
||||
new Setting(containerEl)
|
||||
.setName("Ignore patterns")
|
||||
.setDesc(
|
||||
"Patterns to ignore when syncing. Each line is a separate glob pattern. Patterns are matched against the relative path of the file. For example, to ignore all files in a folder named 'ignore', enter 'ignore/*'. To ignore all files with the extension '.log', enter '*.log'."
|
||||
)
|
||||
.addTextArea((text) =>
|
||||
text
|
||||
.setValue(
|
||||
this.syncClient.getSettings().ignorePatterns.join("\n")
|
||||
)
|
||||
.setPlaceholder("Enter patterns to ignore, one per line")
|
||||
.onChange(async (value) => {
|
||||
const patterns = value
|
||||
.split("\n")
|
||||
.map((pattern) => pattern.trim())
|
||||
.filter((pattern) => pattern.length > 0);
|
||||
return this.syncClient.setSetting(
|
||||
"ignorePatterns",
|
||||
patterns
|
||||
);
|
||||
})
|
||||
);
|
||||
|
||||
new Setting(containerEl)
|
||||
.setName("Sync concurrency")
|
||||
.setDesc(
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue