mirror of
https://github.com/rust-lang/rust-analyzer
synced 2025-01-12 21:28:51 +00:00
Use EXE extension for pre-commit hook on Window
This commit is contained in:
parent
de8f72aad9
commit
8890539e40
1 changed files with 5 additions and 1 deletions
|
@ -115,7 +115,11 @@ pub fn install_rustfmt() -> Result<()> {
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn install_format_hook() -> 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() {
|
if !result_path.exists() {
|
||||||
run("cargo build --package tools --bin pre-commit", ".")?;
|
run("cargo build --package tools --bin pre-commit", ".")?;
|
||||||
if cfg!(windows) {
|
if cfg!(windows) {
|
||||||
|
|
Loading…
Reference in a new issue