jevhooks.git / tools / with-secrets.sh
1#!/usr/bin/env bash

Run a command with the daemon's key in its environment.

tools/with-secrets.sh <command> [args...]

TYPESAFE_API_KEY is declared, without a value, in fnox.toml. With fnox installed and a provider set up for it the command runs under fnox exec; otherwise it simply runs, and the variable must already be in the environment. No value is ever read from a file in this repository.

9set -euo pipefail
10cd "$(dirname "$0")/.."
11if command -v fnox >/dev/null 2>&1 && [ -z "${JEVHOOKS_NO_FNOX:-}" ] && fnox check >/dev/null 2>&1; then
12  exec fnox exec -- "$@"
13fi
14exec "$@"