summaryrefslogtreecommitdiff
path: root/with_env
diff options
context:
space:
mode:
authorJoseph Hunkeler <jhunkeler@users.noreply.github.com>2018-03-02 15:21:29 -0500
committerGitHub <noreply@github.com>2018-03-02 15:21:29 -0500
commite764b438da976807e397103df513506680d064aa (patch)
tree12cdc94e2b6390208f86698d7906fbfd356286dc /with_env
parentca55992134ef987080e4168379dc8f23ca803ca8 (diff)
parent20963a1ff85d198358dd9629b8a1b5f2c2e7edf5 (diff)
downloaddocker-buildsys-e764b438da976807e397103df513506680d064aa.tar.gz
Merge pull request #9 from jhunkeler/add-with_env
Initial commit of with_env handler
Diffstat (limited to 'with_env')
-rwxr-xr-xwith_env23
1 files changed, 23 insertions, 0 deletions
diff --git a/with_env b/with_env
new file mode 100755
index 0000000..6200ebe
--- /dev/null
+++ b/with_env
@@ -0,0 +1,23 @@
+#!/bin/bash
+set +x
+environ=base
+commands=()
+
+while [[ $# > 0 ]]
+do
+ key="$1"
+ case $key in
+ -n|--name)
+ environ="$2"
+ shift 2
+ ;;
+ *)
+ commands+=("$1")
+ shift
+ ;;
+ esac
+done
+
+source activate $environ
+${commands[@]}
+exit $?