24 lines
297 B
Bash
Executable File
24 lines
297 B
Bash
Executable File
#!/bin/sh
|
|
|
|
fail() {
|
|
echo "ERROR: $*" >&2
|
|
exit 1
|
|
}
|
|
|
|
require_file() {
|
|
[ -f "$1" ] || fail "Missing file: $1"
|
|
}
|
|
|
|
require_dir() {
|
|
[ -d "$1" ] || fail "Missing directory: $1"
|
|
}
|
|
|
|
load_env_file() {
|
|
ENV_FILE="$1"
|
|
require_file "$ENV_FILE"
|
|
set -a
|
|
. "$ENV_FILE"
|
|
set +a
|
|
}
|
|
|