1061: Use EXE extension for pre-commit hook on Window r=matklad a=hban

Tested on Git Bash, CMD and Powershell.

Closes: #875 

Co-authored-by: Hrvoje Ban <hban@users.noreply.github.com>
This commit is contained in:
bors[bot] 2019-03-27 07:03:24 +00:00
commit 9816bc5b2d

View file

@ -115,7 +115,11 @@ pub fn install_rustfmt() -> Result<()> {
}
pub fn install_format_hook() -> Result<()> {
let result_path = Path::new("./.git/hooks/pre-commit");
let result_path = Path::new(if cfg!(windows) {
"./.git/hooks/pre-commit.exe"
} else {
"./.git/hooks/pre-commit"
});
if !result_path.exists() {
run("cargo build --package tools --bin pre-commit", ".")?;
if cfg!(windows) {