refactor: use engine in main

Also introduce exit codes: 0 for success, 1 for problem in the
repository under test, 2 for engine problem.

Signed-off-by: Lars Wirzenius <liw@liw.fi>
This commit is contained in:
Lars Wirzenius
2024-01-16 19:20:27 +02:00
parent 52ba6a9081
commit 211bb3a7d1
6 changed files with 43 additions and 420 deletions
+1 -5
View File
@@ -8,7 +8,6 @@ use radicle_ci_broker::msg::{Id, Oid, RunId};
use crate::{
msg::NativeMessageError,
report,
runcmd::RunCmdError,
runinfo::RunInfoError,
runlog::{RunLog, RunLogError},
runspec::{RunSpec, RunSpecError},
@@ -187,7 +186,7 @@ impl Run {
self.run_log.runcmd(
argv,
&cwd.canonicalize()
.map_err(|e| RunCmdError::Canonicalize(cwd.into(), e))?,
.map_err(|e| RunError::Canonicalize(cwd.into(), e))?,
exit,
&output.stdout,
&output.stderr,
@@ -221,9 +220,6 @@ pub enum RunError {
#[error(transparent)]
Report(#[from] report::ReportError),
#[error(transparent)]
RunCmd(#[from] RunCmdError),
#[error(transparent)]
RunInfo(#[from] RunInfoError),