lib: Add include guard to constants.sh to lower startup time

This commit is contained in:
Ethan P 2020-04-27 19:05:42 -07:00
parent 8524f873fb
commit a31b322272
No known key found for this signature in database
GPG Key ID: 6963FD04F6CF35EA

View File

@ -5,6 +5,10 @@
# Repository: https://github.com/eth-p/bat-extras
# Issues: https://github.com/eth-p/bat-extras/issues
# -----------------------------------------------------------------------------
if [[ -z "$__LIB_CONSTANTS_INITIALIZED" ]]; then
__LIB_CONSTANTS_INITIALIZED=true
# Constants
EXECUTABLE_BAT="bat"
EXECUTABLE_GIT="git"
EXECUTABLE_DELTA="delta"
@ -18,3 +22,5 @@ PROGRAM_VERSION="$({
printf "%s-git (%s)" "" "$(git -C "${TOP}" rev-parse --short HEAD)"
fi
})"
fi