summaryrefslogtreecommitdiff
path: root/bin
diff options
context:
space:
mode:
authorJacob Vosmaer <jacob@gitlab.com>2017-03-14 17:48:32 +0100
committerJacob Vosmaer <jacob@gitlab.com>2017-03-21 14:55:41 +0100
commit275b7797c1fa104e4a0b94823ed48ec7157a50a9 (patch)
tree66119818e2db473e2cbbeeafb50a33ae7b89f108 /bin
parent49a9c2fbefde96e428eae72a76ceefeac9dbcad4 (diff)
downloadgitlab-ce-275b7797c1fa104e4a0b94823ed48ec7157a50a9.tar.gz
Add gitaly source installation instructions
Diffstat (limited to 'bin')
-rwxr-xr-xbin/with_env16
1 files changed, 16 insertions, 0 deletions
diff --git a/bin/with_env b/bin/with_env
new file mode 100755
index 00000000000..e678fa2f0cc
--- /dev/null
+++ b/bin/with_env
@@ -0,0 +1,16 @@
+#!/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
+. "${env_file}"
+set +a
+
+exec "$@"