feat(cli): automatically use .taurignore, ref #4617 (#4623)

This commit is contained in:
Lucas Fernandes Nogueira 2022-07-28 18:58:38 -03:00 committed by GitHub
parent 77e48ab7db
commit 596fa08d48
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 11 additions and 0 deletions

View File

@ -0,0 +1,6 @@
---
"cli.rs": patch
"cli.js": patch
---
Automatically use any `.taurignore` file as ignore rules for dev watcher and app path finder.

3
examples/api/.taurignore Normal file
View File

@ -0,0 +1,3 @@
src-tauri/locales/
src-tauri/Cross.toml
src-tauri/.gitignore

View File

@ -26,6 +26,7 @@ fn lookup<F: Fn(&PathBuf, FileType) -> bool>(dir: &Path, checker: F) -> Option<P
}
let mut builder = WalkBuilder::new(dir);
builder.add_custom_ignore_filename(".taurignore");
let _ = builder.add_ignore(default_gitignore);
builder
.require_git(false)

View File

@ -235,6 +235,7 @@ fn lookup<F: FnMut(FileType, PathBuf)>(dir: &Path, mut f: F) {
}
let mut builder = ignore::WalkBuilder::new(dir);
builder.add_custom_ignore_filename(".taurignore");
let _ = builder.add_ignore(default_gitignore);
if let Ok(ignore_file) = std::env::var("TAURI_DEV_WATCHER_IGNORE_FILE") {
builder.add_ignore(ignore_file);