Radish alpha
r
rad:z3qg5TKmN83afz2fj9z3fQjU8vaYE
Radicle CI adapter for native CI
Radicle
Git
fix: if a command fails, fail the CI run
Lars Wirzenius committed 2 years ago
commit 44e5c53a31d7c12deb33740b4291acc5acafa4c7
parent 4f8bd94
1 file changed +7 -1
modified src/main.rs
@@ -234,7 +234,10 @@ fn runcmd(log: &mut LogFile, argv: &[&str], cwd: &Path) -> Result<(), NativeErro
        error
            .to_writer(std::io::stdout())
            .map_err(|e| NativeError::WriteResponse(error.clone(), e))?;
-
        return Ok(());
+
        return Err(NativeError::CommandFailed(
+
            exit.code().unwrap(),
+
            argv.iter().map(|s| s.to_string()).collect(),
+
        ));
    }
    Ok(())
}
@@ -499,4 +502,7 @@ enum NativeError {

    #[error("failed to run command {0:?}")]
    Command(Vec<String>, #[source] std::io::Error),
+

+
    #[error("command failed with exit code {0}: {1:?}")]
+
    CommandFailed(i32, Vec<String>),
}