From 20963a1ff85d198358dd9629b8a1b5f2c2e7edf5 Mon Sep 17 00:00:00 2001 From: Joseph Hunkeler Date: Fri, 2 Mar 2018 15:15:20 -0500 Subject: Initial commit of with_env handler --- with_env | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100755 with_env (limited to 'with_env') 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 $? -- cgit