Fix empty lines in command output when communicating with daemon\n\nfixes #76

This commit is contained in:
elkowar 2020-12-26 13:11:15 +01:00
parent 4404ab4d5d
commit f7d6bd4cb3

View file

@ -30,6 +30,8 @@ pub fn forward_command_to_server(mut stream: UnixStream, action: opts::ActionWit
let mut buf = String::new();
stream.set_read_timeout(Some(std::time::Duration::from_millis(100)))?;
stream.read_to_string(&mut buf)?;
println!("{}", buf);
if !buf.is_empty() {
println!("{}", buf);
}
Ok(())
}