diff options
author | Hrvoje Ban <[email protected]> | 2019-03-27 06:52:59 +0000 |
---|---|---|
committer | Hrvoje Ban <[email protected]> | 2019-03-27 06:52:59 +0000 |
commit | 8890539e400d20f44b85f056b0b456967f5a1a53 (patch) | |
tree | 68dca6141a2e3c7eb79b9b766e5833e9ecd695b5 | |
parent | de8f72aad9d708fd26e450779623dd5cd4e38568 (diff) |
Use EXE extension for pre-commit hook on Window
-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) { |