Skip to content

Instantly share code, notes, and snippets.

@JoonHoSon
Created September 6, 2023 12:54
Show Gist options
  • Save JoonHoSon/01f1db2c63df55dfd47beaf1dace463e to your computer and use it in GitHub Desktop.
Save JoonHoSon/01f1db2c63df55dfd47beaf1dace463e to your computer and use it in GitHub Desktop.
pre-push-cargo-test
#!/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