pars-core 0.2.4

Pars(a zx2c4-pass compatible passwords manager) core library
Documentation
use std::path::Path;
use std::process::{Command, Stdio};

use anyhow::{anyhow, Result};
pub fn git_io(executable: &str, work_dir: &Path, args: &[&str]) -> Result<()> {
    let status = Command::new(executable)
        .args(args)
        .current_dir(work_dir)
        .stdin(Stdio::inherit())
        .stdout(Stdio::inherit())
        .stderr(Stdio::inherit())
        .spawn()?
        .wait()?;

    if status.success() {
        Ok(())
    } else {
        Err(anyhow!(format!("Failed to run git command, code {:?}", status)))
    }
}