From 777acc8a1782c9c623bed230006b3165bf38c638 Mon Sep 17 00:00:00 2001 From: NOGISAKA Sadata Date: Sat, 7 Sep 2019 22:48:33 +0900 Subject: [PATCH] Make sure setting variable `DIR` before called on scripts/_build.sh --- scripts/_build.sh | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/scripts/_build.sh b/scripts/_build.sh index 6caa0c3c5..13fa2ef72 100755 --- a/scripts/_build.sh +++ b/scripts/_build.sh @@ -2,6 +2,10 @@ set -euo pipefail +DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )/../" +OUT_D=${OUT_D:-${DIR}/builds} +mkdir -p "$OUT_D" + base="-X github.com/digitalocean/doctl." build="$("$DIR"/scripts/version.sh -c)" ldflags="${base}Build=${build}" @@ -16,10 +20,6 @@ ldflags="${ldflags} ${base}Minor=${minor}" patch="$(echo "$version" | cut -d . -f3)" ldflags="${ldflags} ${base}Patch=${patch}" -DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )/../" -OUT_D=${OUT_D:-${DIR}/builds} -mkdir -p "$OUT_D" - ( export GOOS=${GOOS:-linux} export GOARCH=${GOARCH:-amd64}