Stop pre-commit hook from installing programs
This commit is contained in:
parent
7977e0b2da
commit
5d16b11ffc
1 changed files with 7 additions and 9 deletions
|
@ -1,16 +1,14 @@
|
|||
#!/bin/sh
|
||||
|
||||
if ! which rustup &> /dev/null; then
|
||||
curl https://sh.rustup.rs -sSf | sh -s -- -y
|
||||
export PATH=$PATH:$HOME/.cargo/bin
|
||||
if ! which rustup &> /dev/null; then
|
||||
echo "Failed to install rustup"
|
||||
fi
|
||||
if ! which cargo &> /dev/null; then
|
||||
echo "Commit aborted! Please install cargo and rustfmt to check the code style of Fractal."
|
||||
exit -1
|
||||
fi
|
||||
|
||||
if ! rustup component list|grep rustfmt &> /dev/null; then
|
||||
echo "Installing rustfmt.."
|
||||
rustup component add rustfmt
|
||||
if ! cargo fmt --help &> /dev/null; then
|
||||
echo "Commit aborted! You need rustfmt to check the code style of Fractal."
|
||||
echo "Install it via rustup ('rustup component add rustfmt') or your package manager."
|
||||
exit -1
|
||||
fi
|
||||
|
||||
echo "--Checking style--"
|
||||
|
|
Loading…
Reference in a new issue