did stuff

This commit is contained in:
robojerk 2025-08-26 09:25:35 -07:00
parent 1ce92776e1
commit 1e49de4997
6 changed files with 466 additions and 229 deletions

View file

@ -22,17 +22,17 @@ pub struct CommandOutput {
///
fn create_command<T: AsRef<OsStr>>(binary_name: T) -> Result<Command> {
let binary_name = binary_name.as_ref();
log::trace!("Creating Command for binary {}", binary_name.display());
log::trace!("Creating Command for binary {}", binary_name.to_string_lossy());
let full_path = match which::which(binary_name) {
Ok(full_path) => {
log::trace!("Using {} as {}", full_path.display(), binary_name.display());
log::trace!("Using {} as {}", full_path.to_string_lossy(), binary_name.to_string_lossy());
full_path
}
Err(error) => {
log::trace!(
"Unable to find {} in PATH, {error:?}",
binary_name.display()
binary_name.to_string_lossy()
);
return Err(Error::new(ErrorKind::NotFound, error));
}
@ -71,7 +71,7 @@ fn exec_timeout(cmd: &mut Command, time_limit: Duration) -> Option<CommandOutput
let process = match cmd.spawn() {
Ok(process) => process,
Err(error) => {
log::trace!("Unable to run {}, {:?}", cmd.get_program().display(), error);
log::trace!("Unable to run {}, {:?}", cmd.get_program().to_string_lossy(), error);
return None;
}
};
@ -117,7 +117,7 @@ fn exec_timeout(cmd: &mut Command, time_limit: Duration) -> Option<CommandOutput
Ok(None) => {
log::warn!(
"Executing command {} timed out.",
cmd.get_program().display()
cmd.get_program().to_string_lossy()
);
log::warn!(
"You can set command_timeout in your config to a higher value to allow longer-running commands to keep executing."
@ -127,7 +127,7 @@ fn exec_timeout(cmd: &mut Command, time_limit: Duration) -> Option<CommandOutput
Err(error) => {
log::trace!(
"Executing command {} failed by: {:?}",
cmd.get_program().display(),
cmd.get_program().to_string_lossy(),
error
);
None