step nine: Ignore .rgit files
This commit is contained in:
parent
852157e955
commit
97f9c41bc9
13
src/base.rs
13
src/base.rs
|
@ -8,6 +8,11 @@ pub fn write_tree(directory: String) {
|
|||
let metadata = item.metadata().unwrap();
|
||||
let name = item.file_name();
|
||||
let full = format!("{}/{}", directory, name.to_str().unwrap());
|
||||
|
||||
if is_ignored(&full) {
|
||||
continue;
|
||||
}
|
||||
|
||||
if metadata.is_file() {
|
||||
println!("{}", full);
|
||||
} else if metadata.is_dir() {
|
||||
|
@ -15,3 +20,11 @@ pub fn write_tree(directory: String) {
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
fn is_ignored(path: &String) -> bool {
|
||||
if path.contains(".rgit") {
|
||||
true
|
||||
} else {
|
||||
false
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue