fix: load local env file correctly in backup script
All checks were successful
ITAM Code Check / build-and-config-check (push) Successful in 20s

This commit is contained in:
2026-06-19 15:53:04 +09:00
parent 15c5cbaca2
commit 5678e28c66

View File

@@ -28,9 +28,14 @@ has_command() {
load_env() {
[ -f "$ENV_FILE" ] || fail "Env file not found: $ENV_FILE"
case "$ENV_FILE" in
*/*) env_path="$ENV_FILE" ;;
*) env_path="./$ENV_FILE" ;;
esac
set -a
# shellcheck disable=SC1090
. "$ENV_FILE"
. "$env_path"
set +a
: "${DB_HOST:?DB_HOST is required in $ENV_FILE}"