summaryrefslogtreecommitdiff
path: root/with_env
blob: 6c19889ec084967f80062808295399214371434d (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 $?