Browse Source

Ignore stdout from subprocess

master
Schneider 3 years ago
parent
commit
4c87a17b79
  1. 9
      src/main.rs

9
src/main.rs

@ -2,6 +2,7 @@ use chrono::prelude::*;
use chrono::Duration;
use std::io::Error;
use std::io::{stdout, Result, StdoutLock, Write};
use std::process::Stdio;
use std::process::{Command, Output};
use std::thread::sleep;
@ -13,7 +14,13 @@ fn main() {
/// Check if kdialog exists. If not, print message and return Err()
fn check_deps() -> Result<()> {
let cmd = Command::new("sh").arg("-c").arg("kdialog").status()?;
let cmd = Command::new("sh")
.arg("-c")
.arg("kdialog")
.arg("--version")
.stdout(Stdio::null())
.stderr(Stdio::null())
.status()?;
if !cmd.success() {
println!("Could not find command 'kdialog'. Please install first, then start again");
return Err(Error::new(

Loading…
Cancel
Save