-
Notifications
You must be signed in to change notification settings - Fork 213
/
.envrc
81 lines (60 loc) · 1.66 KB
/
.envrc
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
73
74
75
76
77
78
79
80
81
direnv_version_major=$(direnv version | cut -d "." -f1 | tr -d '\n')
direnv_version_minor=$(direnv version | cut -d "." -f2 | tr -d '\n')
if [[ $direnv_version_major -lt 2 ]] || [[ $direnv_version_major -eq 2 ]] && [[ $direnv_version_minor -lt 32 ]]; then
echo -e "\033[31munsupported direnv version $(direnv version) < 2.32.x"
exit 1
fi
if [[ "$SHELL" == "bash" ]]; then
if [ "${BASH_VERSINFO:-0}" -lt 4 ]; then
echo -e "\033[31mthe environment needs BASH 4 or above" >&2
exit 1
fi
fi
if ! has make ; then
echo "make is not installed"; exit 1
fi
if ! has unzip ; then
echo "unzip is not installed"; exit 1
fi
if ! has wget ; then
echo "wget is not installed"; exit 1
fi
if ! has curl ; then
echo "curl is not installed"; exit 1
fi
if ! has npm ; then
echo "npm is not installed"; exit 1
fi
if ! has jq ; then
echo "jq is not installed"; exit 1
fi
if ! has readlink ; then
echo "readlink is not installed"; exit 1
fi
if [ -z "$GOPATH" ]; then
GOPATH=$(go env GOPATH)
export GOPATH
fi
AKASH_ROOT=$(pwd)
export AKASH_ROOT
dotenv
dotenv_if_exists dev.env
TOOLS=${AKASH_ROOT}/script/tools.sh
SEMVER=${AKASH_ROOT}/script/semver.sh
GOTOOLCHAIN=$(${TOOLS} gotoolchain)
GOTOOLCHAIN_SEMVER=$(echo "${GOTOOLCHAIN}" | sed 's/go*/v/' | tr -d '\n')
if [[ "$OSTYPE" == "darwin"* ]]; then
# on MacOS disable deprecation warnings security framework
CGO_CFLAGS=-Wno-deprecated-declarations
export CGO_CFLAGS
fi
export SEMVER
export GOTOOLCHAIN
export GOTOOLCHAIN_SEMVER
PATH_add "$AKASH_DEVCACHE_NODE_BIN"
PATH_add "$AKASH_DEVCACHE_BIN"
AKASH_DIRENV_SET=1
AKASH=$AKASH_DEVCACHE_BIN/akash
export AKASH_DIRENV_SET
export AKASH
make cache