From 10d34532e3e96ffd92c11e667deb453188c28282 Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Tue, 11 Jun 2019 01:47:37 +0300 Subject: rename tools -> ra_tools This should help with caching on CI I hope (see .travis.yml before_cache) --- crates/tools/src/bin/pre-commit.rs | 28 ---------------------------- 1 file changed, 28 deletions(-) delete mode 100644 crates/tools/src/bin/pre-commit.rs (limited to 'crates/tools/src/bin/pre-commit.rs') diff --git a/crates/tools/src/bin/pre-commit.rs b/crates/tools/src/bin/pre-commit.rs deleted file mode 100644 index ea18c0863..000000000 --- a/crates/tools/src/bin/pre-commit.rs +++ /dev/null @@ -1,28 +0,0 @@ -use std::process::Command; - -use failure::bail; - -use tools::{Result, run_rustfmt, run, project_root}; - -fn main() -> tools::Result<()> { - run_rustfmt(tools::Overwrite)?; - update_staged() -} - -fn update_staged() -> Result<()> { - let root = project_root(); - let output = Command::new("git") - .arg("diff") - .arg("--diff-filter=MAR") - .arg("--name-only") - .arg("--cached") - .current_dir(&root) - .output()?; - if !output.status.success() { - bail!("`git diff --diff-filter=MAR --name-only --cached` exited with {}", output.status); - } - for line in String::from_utf8(output.stdout)?.lines() { - run(&format!("git update-index --add {}", root.join(line).to_string_lossy()), ".")?; - } - Ok(()) -} -- cgit v1.2.3