@@ -2,72 +2,107 @@ direnv_version_major=$(direnv version | cut -d "." -f1 | tr -d '\n')
22direnv_version_minor=$( direnv version | cut -d " ." -f2 | tr -d ' \n' )
33
44if [[ $direnv_version_major -lt 2 ]] || [[ $direnv_version_major -eq 2 ]] && [[ $direnv_version_minor -lt 32 ]]; then
5- echo -e " \033[31munsupported direnv version $( direnv version) < 2.32.x"
6- exit 1
5+ echo -e " \033[31munsupported direnv version $( direnv version) < 2.32.x"
6+ exit 1
77fi
88
9- if [[ " $SHELL " == " bash" ]]; then
10- if [ " ${BASH_VERSINFO:- 0} " -lt 4 ]; then
11- echo -e " \033[31mthe environment needs BASH 4 or above" >&2
12- exit 1
13- fi
9+ if [[ " $( ps -p " $$ " -o ' comm= ' ) " =~ " bash" ]]; then
10+ if [ " ${BASH_VERSINFO:- 0} " -lt 4 ]; then
11+ echo -e " \033[31mthe environment needs BASH 4 or above" >&2
12+ exit 1
13+ fi
1414fi
1515
16- if ! has make ; then
17- echo " make is not installed" ; exit 1
16+ if ! has make; then
17+ echo " make is not installed"
18+ exit 1
1819fi
1920
20- if ! has unzip ; then
21- echo " unzip is not installed" ; exit 1
21+ if ! has unzip; then
22+ echo " unzip is not installed"
23+ exit 1
2224fi
2325
24- if ! has wget ; then
25- echo " wget is not installed" ; exit 1
26+ if ! has wget; then
27+ echo " wget is not installed"
28+ exit 1
2629fi
2730
28- if ! has curl ; then
29- echo " curl is not installed" ; exit 1
31+ if ! has curl; then
32+ echo " curl is not installed"
33+ exit 1
3034fi
3135
32- if ! has npm ; then
33- echo " npm is not installed" ; exit 1
36+ if ! has npm; then
37+ echo " npm is not installed"
38+ exit 1
3439fi
3540
36- if ! has jq ; then
37- echo " jq is not installed" ; exit 1
41+ if ! has jq; then
42+ echo " jq is not installed"
43+ exit 1
3844fi
3945
40- if ! has readlink ; then
41- echo " readlink is not installed" ; exit 1
46+ if ! has readlink; then
47+ echo " readlink is not installed"
48+ exit 1
49+ fi
50+
51+ if ! has pv; then
52+ echo " pv is not installed"
53+ exit 1
54+ fi
55+
56+ if ! has lz4; then
57+ echo " lz4 is not installed"
58+ exit 1
59+ fi
60+
61+ if ! has git-cliff; then
62+ echo " git-cliff is not installed"
63+ exit 1
4264fi
4365
4466if [ -z " $GOPATH " ]; then
45- GOPATH=$( go env GOPATH)
46- export GOPATH
67+ GOPATH=$( go env GOPATH)
68+ export GOPATH
4769fi
4870
4971AKASH_ROOT=$( pwd)
5072export AKASH_ROOT
5173
5274dotenv
53- dotenv_if_exists dev.env
5475
5576TOOLS=${AKASH_ROOT} /script/tools.sh
5677SEMVER=${AKASH_ROOT} /script/semver.sh
5778
5879GOTOOLCHAIN=$( ${TOOLS} gotoolchain)
5980GOTOOLCHAIN_SEMVER=$( echo " ${GOTOOLCHAIN} " | sed ' s/go*/v/' | tr -d ' \n' )
6081
82+ dotenv_if_exists dev.env
83+
84+ if [[ ${GOWORK} != " off" ]] && [[ -f go.work ]]; then
85+ GOWORK=${AKASH_ROOT} /go.work
86+ else
87+ GOWORK=off
88+ fi
89+
6190if [[ " $OSTYPE " == " darwin" * ]]; then
62- # on MacOS disable deprecation warnings security framework
63- CGO_CFLAGS=-Wno-deprecated-declarations
91+ # on MacOS disable deprecation warnings security framework
92+ CGO_CFLAGS=-Wno-deprecated-declarations
93+
94+ export CGO_CFLAGS
95+ fi
6496
65- export CGO_CFLAGS
97+ if [ -z " ${GOARCH} " ]; then
98+ GOARCH=$( go env GOARCH)
99+ export GOARCH
66100fi
67101
68102export SEMVER
69103export GOTOOLCHAIN
70104export GOTOOLCHAIN_SEMVER
105+ export GOWORK
71106
72107PATH_add " $AKASH_DEVCACHE_NODE_BIN "
73108PATH_add " $AKASH_DEVCACHE_BIN "
0 commit comments