Add method to check job extension on path

This commit is contained in:
Kienan Stewart 2022-09-25 18:12:20 -04:00
parent da4e79463f
commit 518f0b284f
1 changed files with 14 additions and 0 deletions

View File

@ -63,6 +63,20 @@ impl Job {
};
}
pub fn has_job_file_extension(path: &Path) -> bool {
match path.extension() {
Some(x) => {
if ! "job".eq(x) {
return false;
}
},
None => {
return false;
}
};
return true;
}
pub fn new(url: &str, selector: &str, conf: &Conf) -> Job {
let mut job = Job::default(conf);
job.url = url.to_string();