mirror of
https://github.com/archtechx/todo-system.git
synced 2025-12-12 17:14:03 +00:00
more gitignore logic improvements
This commit is contained in:
parent
df395e08ef
commit
d08da09de1
2 changed files with 9 additions and 3 deletions
|
|
@ -107,6 +107,10 @@ pub fn add_excludes_from_gitignore(base_dir: &PathBuf, excludes: &mut Vec<PathBu
|
|||
}
|
||||
|
||||
for line in std::fs::read_to_string(gitignore).unwrap().lines() {
|
||||
if line.trim().is_empty() {
|
||||
continue;
|
||||
}
|
||||
|
||||
if line.trim() == "*" {
|
||||
if let Ok(realpath) = canonicalize(&base_dir) {
|
||||
excludes.push(realpath);
|
||||
|
|
@ -119,6 +123,10 @@ pub fn add_excludes_from_gitignore(base_dir: &PathBuf, excludes: &mut Vec<PathBu
|
|||
continue;
|
||||
}
|
||||
|
||||
if line.trim().starts_with('#') {
|
||||
continue;
|
||||
}
|
||||
|
||||
let mut pattern = base_dir.clone();
|
||||
pattern.push(line.trim_end_matches("*/").trim_matches('/'));
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue