Program can now run without figlet

This commit is contained in:
iVacon 2023-06-08 15:42:43 +03:00
parent 0720723e09
commit 1ca0fb7327

View file

@ -45,10 +45,12 @@ fn main() {
let figlet = Command::new("figlet")
.args(["-f", "smslant", &distro_name.clone()])
.output();
let figlet = figlet.unwrap();
let figlet = String::from_utf8_lossy(&figlet.stdout);
if figlet.is_err() == false {
let figlet = figlet.unwrap();
let figlet = String::from_utf8_lossy(&figlet.stdout);
print!("{}", figlet);
}
// Print all the things we've been saving.
print!("{}", figlet);
println!("{}@{}", user.clone().trim(), hostname.clone().trim());