Last active
January 31, 2024 22:21
-
-
Save AliveDevil/8043e4d3c53bea1d1b9937b672df86f3 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
SERVICE_NAME=${1?"Arg 1 should be set to the service name"} | |
WORKDIR=${2?"Arg 2 should be set to the workdir"} | |
WORKDIR=$(realpath "${WORKDIR:+${WORKDIR}/}") | |
ENV_FILE=".env.${SERVICE_NAME}" | |
ENV_PATH="${WORKDIR}/${ENV_FILE}" | |
set -a | |
[ -f "${ENV_PATH}" ] && . "${ENV_PATH}" | |
set +a |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment