fix: gitignore builder (#2689)
This commit is contained in:
1 parent
4ccd9ffe19
commit
71a48686dc
1 file changed
+10
-3
@@ -38,8 +38,12 @@ impl Watcher {
|
||||
allow_watch_path.dedup();
|
||||
|
||||
let crate_dir = config.crate_dir();
|
||||
let gitignore_file_path = crate_dir.join(".gitignore");
|
||||
let mut builder = ignore::gitignore::GitignoreBuilder::new(gitignore_file_path);
|
||||
let mut builder = ignore::gitignore::GitignoreBuilder::new(&crate_dir);
|
||||
builder.add(crate_dir.join(".gitignore"));
|
||||
|
||||
let out_dir = config.out_dir();
|
||||
let out_dir_str = out_dir.display().to_string();
|
||||
|
||||
let excluded_paths = vec![
|
||||
".git",
|
||||
".github",
|
||||
@@ -48,9 +52,12 @@ impl Watcher {
|
||||
"node_modules",
|
||||
"dist",
|
||||
".dioxus",
|
||||
&out_dir_str,
|
||||
];
|
||||
for path in excluded_paths {
|
||||
builder.add(path);
|
||||
builder
|
||||
.add_line(None, path)
|
||||
.expect("failed to add path to file excluder");
|
||||
}
|
||||
let ignore = builder.build().unwrap();
|
||||
|
||||
|
||||
Reference in new issue
Block a user