From 930e02d80229b2a2d5e794cd85065de33e6fa1e1 Mon Sep 17 00:00:00 2001 From: Steppy Date: Mon, 3 Feb 2025 02:19:01 +0100 Subject: [PATCH] Add remaining TODOs --- src/command.rs | 1 + src/main.rs | 6 +++++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/src/command.rs b/src/command.rs index b301a1f..6474703 100644 --- a/src/command.rs +++ b/src/command.rs @@ -9,6 +9,7 @@ use std::process::{Command, ExitStatus, Output}; pub trait LogRunnable { fn run(&mut self, logger: &Logger) -> Result<(), SpecificExecutionError>; fn collect_output(&mut self) -> Result; + //TODO collect_full_output } impl LogRunnable for Command { diff --git a/src/main.rs b/src/main.rs index aa6ec71..10c6fdf 100644 --- a/src/main.rs +++ b/src/main.rs @@ -208,6 +208,7 @@ fn main() -> Result<(), String> { Some(file_server) => match &file_server.address { ServerAddress::Ssh { ssh_address } => { //canonicalize remote files + //TODO only join when there are multiple paths let joined_files = osf!("{{") + files .iter() @@ -215,6 +216,8 @@ fn main() -> Result<(), String> { .collect::>() .join(&OsString::from(",")) + "}"; + + //TODO handle bad exit status let realpath_output = ShellCmd::new("ssh") .arg(ssh_address) .arg(osf!("realpath ") + file_server.server_directory_path.join(joined_files)) @@ -225,6 +228,7 @@ fn main() -> Result<(), String> { .split(|&b| b == b'\n') //split at line breaks .map(|bytes| PathBuf::from(OsStr::from_bytes(bytes))) .collect(); + log!(logger, debug, "canonical files: {files:?}"); for file in &files { check_file_exists_on_server(file, ssh_address, &file_server.server_directory_path)?; @@ -587,7 +591,7 @@ where error: ExecutionError::BadExitStatus(_), //test failed .. }) => Err(format!( - "File '{}' doesn't exist on file server", + "File '{}' doesn't exist on file-server", full_path.to_string_lossy() )), Err(e) => Err(format!(