rgch 0.1.33

Rust version of gch
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
use crate::{
    misc::{exit_msg, warning},
    proc::{execute, execute_out},
};
use std::process::exit;

const LOG_CMD: &str = "git log --stat --oneline --graph --decorate";

pub fn log() {
    let (_, exit_code) = execute_out(LOG_CMD);
    if exit_code > 0 {
        warning("Nothing is commited");
        exit_msg(exit_code);
    } else {
        execute(LOG_CMD);
        exit(0);
    }
}