Created
September 6, 2023 12:54
-
-
Save JoonHoSon/01f1db2c63df55dfd47beaf1dace463e to your computer and use it in GitHub Desktop.
pre-push-cargo-test
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
export CARGO_HOME=$HOME/.cargo | |
echo "-------------------------------" | |
echo "Cargo test..." | |
echo "CARGO_HOEM : $CARGO_HOME" | |
echo "-------------------------------" | |
execute=$($CARGO_HOME/bin/cargo test --features local) | |
result=$? | |
if [[ ${result} -ne 0 ]]; then | |
echo "Test failed." | |
exit 1 | |
fi | |
echo "-------------------------------" | |
echo "Cargo build..." | |
echo "-------------------------------" | |
execute=$($CARGO_HOME/bin/cargo build --features local) | |
result=$? | |
if [[ ${result} -ne 0 ]]; then | |
echo "Build failed." | |
exit 1 | |
fi | |
exit 0 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment