git text editor opening bug fixed; display functions for individual

tasks and lists
This commit is contained in:
aaron-jack-manning
2022-08-21 09:58:05 +10:00
parent 1cc7adfeb8
commit 6670cc4c24
9 changed files with 420 additions and 35 deletions

View File

@@ -1,26 +1,22 @@
use crate::error;
use std::io;
use std::str;
use std::path;
use std::process;
use std::io::Write;
pub fn run_command(args : Vec<String>, vault_folder : &path::Path) -> Result<(), error::Error> {
let mut command = process::Command::new("git");
command
let mut child = command
.current_dir(vault_folder)
// Force colour output even though run from other process.
.args(["-c", "color.ui=always"])
.args(args);
.args(args)
.spawn()?;
let output = command.output()?;
let output_string = str::from_utf8(&output.stdout)?;
print!("{}", output_string);
io::stdout().flush()?;
// No point handling the potential error code as Git will report the error directly with more
// info.
let _ = child.wait()?;
Ok(())
}