Skip to content

Commit

Permalink
adding /usr/local/bin/ to the PATH in git hooks, for compatibility wi…
Browse files Browse the repository at this point in the history
…th Sourcetree
  • Loading branch information
semorrison committed Mar 31, 2019
1 parent 5793330 commit e851d3b
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
7 changes: 3 additions & 4 deletions scripts/post-checkout
@@ -1,16 +1,15 @@
#!/bin/sh
export PATH=/usr/local/bin:$PATH
export PATH=$HOME/.mathlib/bin:$PATH

OLD_HEAD=$1
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
Expand Down
5 changes: 4 additions & 1 deletion 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
Expand Down

0 comments on commit e851d3b

Please sign in to comment.