Skip to content

Commit 596fa08

Browse files
authored
feat(cli): automatically use .taurignore, ref #4617 (#4623)
1 parent 77e48ab commit 596fa08

File tree

4 files changed

+11
-0
lines changed

4 files changed

+11
-0
lines changed

.changes/default-ignore-file.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
---
2+
"cli.rs": patch
3+
"cli.js": patch
4+
---
5+
6+
Automatically use any `.taurignore` file as ignore rules for dev watcher and app path finder.

examples/api/.taurignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
src-tauri/locales/
2+
src-tauri/Cross.toml
3+
src-tauri/.gitignore

tooling/cli/src/helpers/app_paths.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ fn lookup<F: Fn(&PathBuf, FileType) -> bool>(dir: &Path, checker: F) -> Option<P
2626
}
2727

2828
let mut builder = WalkBuilder::new(dir);
29+
builder.add_custom_ignore_filename(".taurignore");
2930
let _ = builder.add_ignore(default_gitignore);
3031
builder
3132
.require_git(false)

tooling/cli/src/interface/rust.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -235,6 +235,7 @@ fn lookup<F: FnMut(FileType, PathBuf)>(dir: &Path, mut f: F) {
235235
}
236236

237237
let mut builder = ignore::WalkBuilder::new(dir);
238+
builder.add_custom_ignore_filename(".taurignore");
238239
let _ = builder.add_ignore(default_gitignore);
239240
if let Ok(ignore_file) = std::env::var("TAURI_DEV_WATCHER_IGNORE_FILE") {
240241
builder.add_ignore(ignore_file);

0 commit comments

Comments
 (0)