Skip to content

Commit

Permalink
feat: load additional .trampolinerc file next to trampoline_v2.sh fil…
Browse files Browse the repository at this point in the history
…e if present (#57)
  • Loading branch information
chingor13 authored Nov 4, 2024
1 parent 3de17dd commit c9e4131
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions trampoline_v2.sh
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ set -euo pipefail
# x-release-please-start-version
TRAMPOLINE_VERSION="2.0.11"
# x-release-please-end
CURRENT_DIR=$(dirname "${BASH_SOURCE[0]}")

if command -v tput >/dev/null && [[ -n "${TERM:-}" ]]; then
readonly IO_COLOR_RED="$(tput setaf 1)"
Expand Down Expand Up @@ -281,10 +282,16 @@ required_envvars=(
"TRAMPOLINE_BUILD_FILE"
)

# Load additional trampoline configuration from PROJECT_ROOT
if [[ -f "${PROJECT_ROOT}/.trampolinerc" ]]; then
source "${PROJECT_ROOT}/.trampolinerc"
fi

# Load additional trampoline configuration from shared directory
if [[ "${CURRENT_DIR}" != "${PROJECT_ROOT}" && -f "${CURRENT_DIR}/.trampolinerc" ]]; then
source "${CURRENT_DIR}/.trampolinerc"
fi

log_yellow "Checking environment variables."
for e in "${required_envvars[@]}"
do
Expand Down

0 comments on commit c9e4131

Please sign in to comment.