summaryrefslogtreecommitdiff
path: root/with_env
blob: 6200ebec57f4ce54c05915e0a075a9b2aa0138ad (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
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 $?