AdGuardHome/scripts/make/go-deps.sh
Ainar Garipov 6f7fd33afd Pull request: all: imp scripts
Merge in DNS/adguard-home from imp-sh to master

Squashed commit of the following:

commit 477832e11eca2ef7ac0071b5da938dacb2ed617d
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date:   Wed May 19 20:24:34 2021 +0300

    scripts: rm dbg

commit dbb4b8c783f607781b980dcd57d78085c9022e72
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date:   Wed May 19 20:21:20 2021 +0300

    all: imp code, compat, docs

commit e6e4375d67ad1c213efb04411e3ba0bc6293f936
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date:   Wed May 19 19:33:48 2021 +0300

    all: imp scripts
2021-05-19 20:31:20 +03:00

41 lines
755 B
Bash

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