mirror of
https://seed.radicle.dev/rad:z3qg5TKmN83afz2fj9z3fQjU8vaYE.git
synced 2026-11-21 10:30:49 +08:00
feat: show absolute path name for runcmd "in directory"
This is more helpful than ".". Signed-off-by: Lars Wirzenius <liw@liw.fi>
This commit is contained in:
+9
-2
@@ -1,4 +1,7 @@
|
||||
use std::{path::Path, process::Command};
|
||||
use std::{
|
||||
path::{Path, PathBuf},
|
||||
process::Command,
|
||||
};
|
||||
|
||||
use radicle_ci_broker::msg::{MessageError, Response};
|
||||
|
||||
@@ -18,7 +21,8 @@ pub fn runcmd(run_log: &mut RunLog, argv: &[&str], cwd: &Path) -> Result<(), Run
|
||||
|
||||
run_log.runcmd(
|
||||
argv,
|
||||
cwd,
|
||||
&cwd.canonicalize()
|
||||
.map_err(|e| RunCmdError::Canonicalize(cwd.into(), e))?,
|
||||
exit.code().unwrap(),
|
||||
&output.stdout,
|
||||
&output.stderr,
|
||||
@@ -50,4 +54,7 @@ pub enum RunCmdError {
|
||||
|
||||
#[error("command failed with exit code {0}: {1:?}")]
|
||||
CommandFailed(i32, Vec<String>),
|
||||
|
||||
#[error("failed to make pathname absolute: {0}")]
|
||||
Canonicalize(PathBuf, #[source] std::io::Error),
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user