Last active
June 16, 2020 07:14
-
-
Save rgomezcasas/eea8639c3b316b58bde3378d46a8ea69 to your computer and use it in GitHub Desktop.
TCR
This file contains 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
# ----------- | |
# Explanation | |
mkdir tmp | |
echo "exit 0" > test | |
./test && echo "commit" || echo "revert" | |
# Should output "commit" | |
echo "exit 1" > test | |
./test && echo "commit" || echo "revert" | |
# Should output "revert" | |
# ----------- | |
# PHP Example | |
alias test='./vendor/bin/phpunit' | |
alias commit='git commit -a' | |
alias revert='git commit -am wip; git reset --hard' | |
test && commit || revert |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment