Don't fail when .env is missing

This commit is contained in:
Radon Rosborough 2021-07-06 03:23:06 +00:00
parent 2242905eae
commit b3fea6b0bb
5 changed files with 25 additions and 15 deletions

View File

@ -4,8 +4,10 @@ set -euo pipefail
root="$(cd "$(dirname "$0")/.." && echo "${PWD}")"
if [[ -f "${root}.env" ]]; then
set -a
. "${root}/.env"
set +a
fi
exec node "${root}/tools/depgraph.js" "$@"

View File

@ -6,9 +6,11 @@ root="$(cd "$(dirname "$0")/.." && echo "${PWD}")"
export PATH="$(sed -E "s_:${root}/bin:_:_; s_(^|:)${root}/bin(:|$)__" <<< "${PATH}")"
if [[ -f "${root}.env" ]]; then
set -a
. "${root}/.env"
set +a
fi
if [[ "${OSTYPE:-}" != darwin* ]] && [[ "${EUID}" != 0 ]]; then
exec sudo -E docker "$@"

View File

@ -6,9 +6,11 @@ root="$(cd "$(dirname "$0")/.." && echo "${PWD}")"
export PATH="$(sed -E "s_:${root}/bin:_:_; s_(^|:)${root}/bin(:|$)__" <<< "${PATH}")"
if [[ -f "${root}.env" ]]; then
set -a
. "${root}/.env"
set +a
fi
cd "${root}/packer"

View File

@ -6,9 +6,11 @@ root="$(cd "$(dirname "$0")/.." && echo "${PWD}")"
export PATH="$(sed -E "s_:${root}/bin:_:_; s_(^|:)${root}/bin(:|$)__" <<< "${PATH}")"
if [[ -f "${root}.env" ]]; then
set -a
. "${root}/.env"
set +a
fi
if [[ "${OSTYPE:-}" != darwin* ]] && [[ "${EUID}" != 0 ]]; then
exec sudo -E skopeo "$@"

View File

@ -6,9 +6,11 @@ root="$(cd "$(dirname "$0")/.." && echo "${PWD}")"
export PATH="$(sed -E "s_:${root}/bin:_:_; s_(^|:)${root}/bin(:|$)__" <<< "${PATH}")"
if [[ -f "${root}.env" ]]; then
set -a
. "${root}/.env"
set +a
fi
cd "${root}/tf"