Skip to content

Commit

Permalink
feat(cli): automatically use .taurignore, ref #4617 (#4623)
Browse files Browse the repository at this point in the history
  • Loading branch information
lucasfernog authored Jul 28, 2022
1 parent 77e48ab commit 596fa08
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 0 deletions.
6 changes: 6 additions & 0 deletions .changes/default-ignore-file.md
Original file line number Diff line number Diff line change
@@ -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 changes: 3 additions & 0 deletions examples/api/.taurignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
src-tauri/locales/
src-tauri/Cross.toml
src-tauri/.gitignore
1 change: 1 addition & 0 deletions tooling/cli/src/helpers/app_paths.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
1 change: 1 addition & 0 deletions tooling/cli/src/interface/rust.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 596fa08

Please sign in to comment.