2020-12-30 18:26:25 +03:00
|
|
|
#!/bin/sh
|
|
|
|
|
|
|
|
verbose="${VERBOSE:-0}"
|
2021-05-19 20:31:20 +03:00
|
|
|
readonly verbose
|
2020-12-30 18:26:25 +03:00
|
|
|
|
|
|
|
if [ "$verbose" -gt '1' ]
|
|
|
|
then
|
|
|
|
env
|
|
|
|
set -x
|
2021-05-19 20:31:20 +03:00
|
|
|
v_flags='-v'
|
|
|
|
x_flags='-x'
|
2020-12-30 18:26:25 +03:00
|
|
|
elif [ "$verbose" -gt '0' ]
|
|
|
|
then
|
|
|
|
set -x
|
2021-05-19 20:31:20 +03:00
|
|
|
v_flags='-v'
|
|
|
|
x_flags=''
|
2020-12-30 18:26:25 +03:00
|
|
|
else
|
|
|
|
set +x
|
2021-05-19 20:31:20 +03:00
|
|
|
v_flags=''
|
|
|
|
x_flags=''
|
2020-12-30 18:26:25 +03:00
|
|
|
fi
|
2021-05-19 20:31:20 +03:00
|
|
|
readonly v_flags x_flags
|
2020-12-30 18:26:25 +03:00
|
|
|
|
|
|
|
set -e -f -u
|
|
|
|
|
|
|
|
go="${GO:-go}"
|
|
|
|
|
2021-05-19 20:31:20 +03:00
|
|
|
# Don't use quotes with flag variables because we want an empty space if those
|
|
|
|
# aren't set.
|
2020-12-30 18:26:25 +03:00
|
|
|
"$go" mod download $x_flags
|
|
|
|
|
2021-01-15 20:30:48 +03:00
|
|
|
# Reset GOARCH and GOOS to make sure we install the tools for the native
|
2021-05-19 20:31:20 +03:00
|
|
|
# architecture even when we're cross-compiling the main binary, and also to
|
|
|
|
# prevent the "cannot install cross-compiled binaries when GOBIN is set" error.
|
2021-01-15 20:30:48 +03:00
|
|
|
env\
|
|
|
|
GOARCH=""\
|
|
|
|
GOOS=""\
|
|
|
|
GOBIN="${PWD}/bin"\
|
|
|
|
"$go" install $v_flags $x_flags\
|
2020-12-30 18:26:25 +03:00
|
|
|
github.com/gobuffalo/packr/packr
|