mirror of
https://github.com/tauri-apps/tauri.git
synced 2026-04-03 10:11:15 +02:00
fix(cli): use matched_path_or_any_parents when checking if a file is ignored (#8903)
* fix: taurignore ignoreing folders not working for watch * docs: add to changes * fix: panic: path is expected to be under the root * Update taurignore-ignoring-folders-not-working-for-watch.md * Update taurignore-ignoring-folders-not-working-for-watch.md
This commit is contained in:
@@ -0,0 +1,6 @@
|
||||
---
|
||||
'tauri-cli': patch:bug
|
||||
'@tauri-apps/cli': patch:bug
|
||||
---
|
||||
|
||||
Fix `.taurignore` failing to ignore in some cases.
|
||||
@@ -263,7 +263,11 @@ struct IgnoreMatcher(Vec<Gitignore>);
|
||||
impl IgnoreMatcher {
|
||||
fn is_ignore(&self, path: &Path, is_dir: bool) -> bool {
|
||||
for gitignore in &self.0 {
|
||||
if gitignore.matched(path, is_dir).is_ignore() {
|
||||
if path.starts_with(gitignore.path())
|
||||
&& gitignore
|
||||
.matched_path_or_any_parents(path, is_dir)
|
||||
.is_ignore()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user