<Comment on #17633 How can I set a default for `GI...
# github-notifications
q
Comment on #17633 How can I set a default for `GIT_COMMIT` when running locally? Discussion answered by kaos By using a
.pants.bootstrap
shell script, it will be sourced before invoking your Pants command so any environment variables that needs to be set or other functionality you need to happen for each call to
./pants
may be placed into that file. Example:
Copy code
# .pants.bootstrap

# Ensure GIT_COMMIT is set
: ${GIT_COMMIT:=$(git rev-parse HEAD)}

# ...
Make sure you have these lines in your
./pants
script. If not you need to update your local
./pants
script first ;) pantsbuild/pants