feat: Add a module for C projects (#3631)

Co-authored-by: David Knaack <davidkna@users.noreply.github.com>
This commit is contained in:
David Cantrell
2022-03-25 04:10:19 +00:00
committed by GitHub
parent b90d1164f5
commit 0863146f07
12 changed files with 371 additions and 0 deletions
+7
View File
@@ -335,6 +335,13 @@ impl<'a> Context<'a> {
Duration::from_millis(self.root_config.command_timeout),
)
}
/// Attempt to execute several commands with exec_cmd, return the results of the first that works
pub fn exec_cmds_return_first(&self, commands: Vec<Vec<&str>>) -> Option<CommandOutput> {
commands
.iter()
.find_map(|attempt| self.exec_cmd(attempt[0], &attempt[1..]))
}
}
#[derive(Debug)]