git text editor opening bug fixed; display functions for individual
tasks and lists
This commit is contained in:
16
src/git.rs
16
src/git.rs
@@ -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(())
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user