job: add processing blacklist to global config
This commit is contained in:
parent
209e1e58c7
commit
512e6cc4d1
|
@ -190,6 +190,13 @@ impl Job {
|
|||
}
|
||||
|
||||
pub(crate) fn run(&mut self, homedir: &Path, config: &GlobalSettings) -> anyhow::Result<()> {
|
||||
if config
|
||||
.blacklist
|
||||
.iter()
|
||||
.any(|re| re.is_match(&self.repo.full_name))
|
||||
{
|
||||
return Ok(());
|
||||
}
|
||||
let local_path = homedir.join(&self.repo.full_name);
|
||||
assert!(local_path.is_absolute());
|
||||
self.local_path = Some(local_path);
|
||||
|
|
|
@ -10,4 +10,8 @@ pub(crate) struct GlobalSettings {
|
|||
/// List of remote stems to use for every repository
|
||||
#[serde(default)]
|
||||
pub additional_remotes: Vec<RepoUrl>,
|
||||
/// List of regexes, if a repository's name matches any of the, it is not mirrored by `lohr`
|
||||
/// even if it contains a `.lorh` file.
|
||||
#[serde(with = "serde_regex")]
|
||||
pub blacklist: Vec<regex::Regex>,
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue