Add a bunch of TODO items

This commit is contained in:
Leonard Steppy 2024-12-13 00:50:24 +01:00
parent 4f75581c8b
commit affdc29df9
2 changed files with 6 additions and 1 deletions

View File

@ -119,6 +119,7 @@ fn main() -> Result<(), String> {
Ok(ServerActions {
server,
actions: {
//TODO don't use debug values here, use joiner
let output = ShellCmd::new("ssh")
.arg(&server.ssh_name)
.arg(format!(
@ -205,6 +206,7 @@ fn main() -> Result<(), String> {
for file_action in server_actions.actions {
match file_action.kind {
Action::Add | Action::Replace => {
//TODO replace with joiner
let mut destination = OsString::from(&server.ssh_name);
destination.push(":");
destination.push(&server.server_directory_path);
@ -221,6 +223,7 @@ fn main() -> Result<(), String> {
.map_err(|e| format!("failed to wait for upload: {e}"))?;
}
Action::Delete => {
//TODO don't use debug values here, use joiner
ShellCmd::new("ssh")
.arg(&server.ssh_name)
.arg(format!(
@ -233,6 +236,7 @@ fn main() -> Result<(), String> {
.map_err(|e| format!("failed to wait for delete command: {e}"))?;
}
Action::Rename { new_name } => {
//TODO don't use debug values, use joiner
ShellCmd::new("ssh")
.arg(&server.ssh_name)
.arg(format!(
@ -254,6 +258,7 @@ fn main() -> Result<(), String> {
start_ssh_agent()?;
for server in servers {
println!("Running command on '{}'...", server.ssh_name);
//TODO don't use debug values, use joiner
ShellCmd::new("ssh")
.arg(server.ssh_name)
.arg(format!("cd {:?}; {command}", server.server_directory_path))

View File

@ -131,7 +131,7 @@ impl FromStr for Server {
impl Display for Server {
fn fmt(&self, f: &mut Formatter<'_>) -> std::fmt::Result {
write!(f, "{}:{:?}", self.ssh_name, self.server_directory_path)
write!(f, "{}:{}", self.ssh_name, self.server_directory_path.to_string_lossy())
}
}