Skip to content

Commit

Permalink
feat(cli): increase lookup depth, add env var option (#3451)
Browse files Browse the repository at this point in the history
  • Loading branch information
lucasfernog committed Feb 14, 2022
1 parent 7e04c07 commit c6031c7
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 1 deletion.
6 changes: 6 additions & 0 deletions .changes/increase-tauri-dir-lookup-depth.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
"cli.rs": patch
"cli.js": patch
---

Increase `tauri.conf.json` directory lookup depth to `3` and allow changing it with the `TAURI_PATH_DEPTH` environment variable.
9 changes: 8 additions & 1 deletion tooling/cli/src/helpers/app_paths.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,14 @@ fn lookup<F: Fn(&PathBuf) -> bool>(dir: &Path, checker: F) -> Option<PathBuf> {

let mut builder = WalkBuilder::new(dir);
let _ = builder.add_ignore(default_gitignore);
builder.require_git(false).ignore(false).max_depth(Some(2));
builder.require_git(false).ignore(false).max_depth(Some(
std::env::var("TAURI_PATH_DEPTH")
.map(|d| {
d.parse()
.expect("`TAURI_PATH_DEPTH` environment variable must be a positive integer")
})
.unwrap_or(3),
));

for entry in builder.build().flatten() {
let path = dir.join(entry.path());
Expand Down

0 comments on commit c6031c7

Please sign in to comment.