Welcome to mirror list, hosted at ThFree Co, Russian Federation.

with_env « bin - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: b0647a50e2744f3e24a7f5a3ea7e0f25251d0ea4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
#!/bin/sh
# Usage: with_env ENV_FILE COMMAND [ARGS...]
#
# This script lets you modify the environment of an executable before
# launching it. It uses an 'env file' which must contain lines like
# 'MY_VARIABLE="my value"'.
#
env_file=$1
shift

# Use set -a to export all variables defined in env_file.
set -a
# shellcheck disable=SC1090
. "${env_file}"
set +a

exec "$@"