2020-12-30 15:26:25 +00:00
|
|
|
#!/bin/sh
|
|
|
|
|
|
|
|
verbose="${VERBOSE:-0}"
|
2021-05-19 17:31:20 +00:00
|
|
|
readonly verbose
|
2020-12-30 15:26:25 +00:00
|
|
|
|
|
|
|
if [ "$verbose" -gt '1' ]
|
|
|
|
then
|
|
|
|
env
|
|
|
|
set -x
|
2021-05-19 17:31:20 +00:00
|
|
|
v_flags='-v'
|
|
|
|
x_flags='-x'
|
2020-12-30 15:26:25 +00:00
|
|
|
elif [ "$verbose" -gt '0' ]
|
|
|
|
then
|
|
|
|
set -x
|
2021-05-19 17:31:20 +00:00
|
|
|
v_flags='-v'
|
|
|
|
x_flags=''
|
2020-12-30 15:26:25 +00:00
|
|
|
else
|
|
|
|
set +x
|
2021-05-19 17:31:20 +00:00
|
|
|
v_flags=''
|
|
|
|
x_flags=''
|
2020-12-30 15:26:25 +00:00
|
|
|
fi
|
2021-05-19 17:31:20 +00:00
|
|
|
readonly v_flags x_flags
|
2020-12-30 15:26:25 +00:00
|
|
|
|
|
|
|
set -e -f -u
|
|
|
|
|
|
|
|
go="${GO:-go}"
|
|
|
|
|
2021-05-19 17:31:20 +00:00
|
|
|
# Don't use quotes with flag variables because we want an empty space if those
|
|
|
|
# aren't set.
|
2020-12-30 15:26:25 +00:00
|
|
|
"$go" mod download $x_flags
|
|
|
|
|
2021-01-15 17:30:48 +00:00
|
|
|
# Reset GOARCH and GOOS to make sure we install the tools for the native
|
2021-05-19 17:31:20 +00: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 17:30:48 +00:00
|
|
|
env\
|
|
|
|
GOARCH=""\
|
|
|
|
GOOS=""\
|
|
|
|
GOBIN="${PWD}/bin"\
|
|
|
|
"$go" install $v_flags $x_flags\
|
2020-12-30 15:26:25 +00:00
|
|
|
github.com/gobuffalo/packr/packr
|