From e851d3bbd7028fb0023fc91502f9f56b3cef8b45 Mon Sep 17 00:00:00 2001 From: Scott Morrison Date: Sun, 31 Mar 2019 16:04:11 +1100 Subject: [PATCH] adding /usr/local/bin/ to the PATH in git hooks, for compatibility with Sourcetree --- scripts/post-checkout | 7 +++---- scripts/post-commit | 5 ++++- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/scripts/post-checkout b/scripts/post-checkout index d0fbd3f443bf7..f82d12a941226 100755 --- a/scripts/post-checkout +++ b/scripts/post-checkout @@ -1,4 +1,5 @@ #!/bin/sh +export PATH=/usr/local/bin:$PATH export PATH=$HOME/.mathlib/bin:$PATH OLD_HEAD=$1 @@ -6,11 +7,9 @@ NEW_HEAD=$2 CHANGED_BRANCH=$3 if [ "$CHANGED_BRANCH" -eq "1" ]; then - # 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 "Trying to fetch cached olean" - cache-olean --fetch + echo "Trying to fetch cached olean" + cache-olean --fetch else echo "'env python3' failed; not running post-checkout hook" fi diff --git a/scripts/post-commit b/scripts/post-commit index a128931dec3ec..d64b1ec8457b7 100755 --- a/scripts/post-commit +++ b/scripts/post-commit @@ -1,9 +1,12 @@ #!/bin/sh +export PATH=/usr/local/bin:$PATH +export PATH=$HOME/.mathlib/bin:$PATH + # 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..." - $HOME/.mathlib/bin/cache-olean + cache-olean else echo "'env python3' failed; not running post-checkout hook" fi