summaryrefslogtreecommitdiff
path: root/src/bin/pre-commit.rs
blob: 361dd9ce3451906b14facb21fc75d93ff265aa2e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
extern crate rust_git_hooks;
use rust_git_hooks::*;

use std::env;
use std::io::{stdin, BufRead};
use std::process;
use std::process::{Command, Stdio};

fn main() {
    log();

    let command = Command::new("cargo")
        .arg("test")
        .stdout(Stdio::inherit())
        .stderr(Stdio::inherit())
        .output()
        .expect("failed to execute process");

    process::exit(command.status.code().unwrap_or(0));
}