diff options
author | bors[bot] <bors[bot]@users.noreply.github.com> | 2019-03-27 07:03:24 +0000 |
---|---|---|
committer | bors[bot] <bors[bot]@users.noreply.github.com> | 2019-03-27 07:03:24 +0000 |
commit | 9816bc5b2dbcaffe9c7c245fad6020a8b37b3531 (patch) | |
tree | 68dca6141a2e3c7eb79b9b766e5833e9ecd695b5 /crates | |
parent | de8f72aad9d708fd26e450779623dd5cd4e38568 (diff) | |
parent | 8890539e400d20f44b85f056b0b456967f5a1a53 (diff) |
Merge #1061
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 <[email protected]>
Diffstat (limited to 'crates')
-rw-r--r-- | crates/tools/src/lib.rs | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/crates/tools/src/lib.rs b/crates/tools/src/lib.rs index 1e29c63d4..11b52ccb7 100644 --- a/crates/tools/src/lib.rs +++ b/crates/tools/src/lib.rs | |||
@@ -115,7 +115,11 @@ pub fn install_rustfmt() -> Result<()> { | |||
115 | } | 115 | } |
116 | 116 | ||
117 | pub fn install_format_hook() -> Result<()> { | 117 | pub fn install_format_hook() -> Result<()> { |
118 | let result_path = Path::new("./.git/hooks/pre-commit"); | 118 | let result_path = Path::new(if cfg!(windows) { |
119 | "./.git/hooks/pre-commit.exe" | ||
120 | } else { | ||
121 | "./.git/hooks/pre-commit" | ||
122 | }); | ||
119 | if !result_path.exists() { | 123 | if !result_path.exists() { |
120 | run("cargo build --package tools --bin pre-commit", ".")?; | 124 | run("cargo build --package tools --bin pre-commit", ".")?; |
121 | if cfg!(windows) { | 125 | if cfg!(windows) { |