-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathactivate
executable file
·72 lines (57 loc) · 1.01 KB
/
activate
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
#! /bin/sh
de () {
_usage () {
echo "Usage: devenv <cmd>"
echo " cmd - Bash command to sandbox."
}
if [ $# -eq 0 ]; then
_usage
return
fi
if [ -f 'dev.env' ]; then
eval $(grep -v '^#' dev.env | sed 's/^/export /g')
else
echo "'dev.env' not found."
fi
if [ -f 'user.env' ]; then
eval $(grep -v '^#' user.env | sed 's/^/export /g')
fi
$@
}
te () {
_usage () {
echo "Usage: testenv <cmd>"
echo " cmd - Bash command to sandbox."
}
if [ $# -eq 0 ]; then
_usage
return
fi
if [ -f 'dev.env' ]; then
eval $(grep -v '^#' dev.env | sed 's/^/export /g')
fi
if [ -f 'test.env' ]; then
eval $(grep -v '^#' test.env | sed 's/^/export /g')
else
echo "'test.env' not found."
fi
$@
}
xe () {
_usage () {
echo "Usage: xenv <env-file> <cmd>"
echo " env-file - Path to env file."
echo " cmd - Bash command to sandbox."
}
if [ $# -lt 2 ]; then
_usage
return
fi
if [ -f $1 ]; then
eval $(grep -v '^#' $1 | sed 's/^/export /g')
else
echo "'$1' not found."
fi
shift
$@
}