ALPHA: wire is a tool to deploy nixos systems wire.althaea.zone/
2
fork

Configure Feed

Select the types of activity you want to include in your feed.

interactive: fix bug for not passing command string to in builder

+5 -7
+5 -7
wire/lib/src/commands/interactive.rs
··· 80 80 /// substitutes STDOUT with #$line. stdout is far less common than stderr. 81 81 const IO_SUBS: &str = "1> >(while IFS= read -r line; do echo \"#$line\"; done)"; 82 82 83 - #[instrument(level = "debug", skip_all, name = "run", fields(elevated = %arguments.elevated))] 83 + #[instrument(level = "debug", skip_all, name = "run-int", fields(elevated = %arguments.elevated))] 84 84 pub(crate) fn interactive_command_with_env<S: AsRef<str>>( 85 85 arguments: &CommandArguments<S>, 86 86 envs: std::collections::HashMap<String, String>, ··· 112 112 113 113 debug!("{command_string}"); 114 114 115 - let mut command = build_command(arguments)?; 115 + let mut command = build_command(arguments, command_string)?; 116 116 117 117 // give command all env vars 118 118 for (key, value) in envs { ··· 241 241 242 242 fn build_command<S: AsRef<str>>( 243 243 arguments: &CommandArguments<'_, S>, 244 + command_string: &String 244 245 ) -> Result<CommandBuilder, HiveLibError> { 245 246 let mut command = if let Some(target) = arguments.target { 246 247 let mut command = create_sync_ssh_command(target, arguments.modifiers)?; ··· 258 259 }; 259 260 260 261 if arguments.elevated { 261 - command.arg(format!( 262 - "sudo -u root -- sh -c '{}'", 263 - arguments.command_string.as_ref() 264 - )); 262 + command.arg(format!("sudo -u root -- sh -c '{command_string}'")); 265 263 } else { 266 - command.arg(arguments.command_string.as_ref()); 264 + command.arg(command_string); 267 265 } 268 266 269 267 Ok(command)