Add support for passing Infisical environment variables

This commit is contained in:
2025-06-01 23:20:54 +02:00
parent 28cf195719
commit 1e72c98f9c

View File

@@ -2,7 +2,17 @@
set -e
main() {
docker compose run --rm --workdir "${PWD}" --volume "${PWD}:${PWD}" -t cli infisical "${@}"
declare -a args=("--rm" "--workdir" "${PWD}" "--volume" "${PWD}:${PWD}" "-t")
if [ -n "${INFISICAL_TOKEN}" ]; then
args+=("--env" "INFISICAL_TOKEN=${INFISICAL_TOKEN}")
fi
if [ -n "${INFISICAL_API_URL:-}" ]; then
args+=("--env" "INFISICAL_API_URL=${INFISICAL_API_URL}")
fi
docker compose run "${args[@]}" cli infisical "${@}"
}
main "${@}"