Skip to content
Snippets Groups Projects
Commit 3de5b434 authored by Casey Faist's avatar Casey Faist
Browse files

add bash pre-commit hook and correct shellcheck warnings

parent c3845fff
No related branches found
No related tags found
No related merge requests found
repos:
- repo: git://github.com/detailyang/pre-commit-shell
rev: 1.0.4
hooks:
- id: shell-lint
...@@ -10,32 +10,32 @@ VENDORED_PYTHON="${VENDOR_URL}/runtimes/$PYTHON_VERSION.tar.gz" ...@@ -10,32 +10,32 @@ VENDORED_PYTHON="${VENDOR_URL}/runtimes/$PYTHON_VERSION.tar.gz"
SECURITY_UPDATE="Python has released a security update! Please consider upgrading to " SECURITY_UPDATE="Python has released a security update! Please consider upgrading to "
# check if runtime exists # check if runtime exists
if curl --output /dev/null --silent --head --fail $VENDORED_PYTHON; then if curl --output /dev/null --silent --head --fail "$VENDORED_PYTHON"; then
if [[ $PYTHON_VERSION == $PY37* ]]; then if [[ "$PYTHON_VERSION" == $PY37* ]]; then
# do things to alert the user of security release available # do things to alert the user of security release available
if [ $PYTHON_VERSION != $LATEST_37 ]; then if [ "$PYTHON_VERSION" != "$LATEST_37" ]; then
puts-warn $SECURITY_UPDATE $LATEST_37 puts-warn "$SECURITY_UPDATE" "$LATEST_37"
echo " Learn More: https://devcenter.heroku.com/articles/python-runtimes" echo " Learn More: https://devcenter.heroku.com/articles/python-runtimes"
fi fi
fi fi
if [[ $PYTHON_VERSION == $PY36* ]]; then if [[ "$PYTHON_VERSION" == $PY36* ]]; then
# security update note # security update note
if [ $PYTHON_VERSION != $LATEST_36 ]; then if [ "$PYTHON_VERSION" != "$LATEST_36" ]; then
puts-warn $SECURITY_UPDATE $LATEST_36 puts-warn "$SECURITY_UPDATE" "$LATEST_36"
echo " Learn More: https://devcenter.heroku.com/articles/python-runtimes" echo " Learn More: https://devcenter.heroku.com/articles/python-runtimes"
fi fi
fi fi
if [[ $PYTHON_VERSION == $PY35* ]]; then if [[ "$PYTHON_VERSION" == $PY35* ]]; then
# security update note # security update note
if [ $PYTHON_VERSION != $LATEST_35 ]; then if [ "$PYTHON_VERSION" != "$LATEST_35" ]; then
puts-warn $SECURITY_UPDATE $LATEST_35 puts-warn "$SECURITY_UPDATE" "$LATEST_35"
echo " Learn More: https://devcenter.heroku.com/articles/python-runtimes" echo " Learn More: https://devcenter.heroku.com/articles/python-runtimes"
fi fi
fi fi
if [[ $PYTHON_VERSION == $PY27* ]]; then if [[ "$PYTHON_VERSION" == $PY27* ]]; then
# security update note # security update note
if [ $PYTHON_VERSION != $LATEST_27 ]; then if [ "$PYTHON_VERSION" != "$LATEST_27" ]; then
puts-warn $SECURITY_UPDATE $LATEST_27 puts-warn "$SECURITY_UPDATE" "$LATEST_27"
echo " Learn More: https://devcenter.heroku.com/articles/python-runtimes" echo " Learn More: https://devcenter.heroku.com/articles/python-runtimes"
fi fi
fi fi
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment