#!/bin/sh
# SourceTree on OS X provides a defective path that doesn't contain python
# https://jira.atlassian.com/browse/SRCTREE-6540
export PATH=$PATH:/usr/local/bin

# hooks are sometimes run from git GUIs with a limited environment
# if python3 isn't available, we don't generate an error; just a message
if /usr/bin/env python3 -c ""; then
	echo "Caching olean..."
	leanproject mk-cache
else
    echo "'env python3' failed; not running post-commit hook"
fi
