From dd1df1ea08464cd489a35ab0985c6b4a5c450d84 Mon Sep 17 00:00:00 2001 From: bernardkkt Date: Sat, 1 May 2021 15:22:24 +0800 Subject: [PATCH 1/2] Point to correct path --- build-wg-go.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build-wg-go.sh b/build-wg-go.sh index 25fd4da..f2cb50d 100644 --- a/build-wg-go.sh +++ b/build-wg-go.sh @@ -8,4 +8,4 @@ set -e GOPATH=`pwd` go get -v -d golang.zx2c4.com/wireguard # Build -GOPATH=`pwd` GOOS=linux GOARCH=amd64 go build -v -o wireguard-go `find . -type d -name "wireguard"` +GOPATH=`pwd` GOOS=linux GOARCH=amd64 go build -v -o wireguard-go `dirname $(find . -type f -name "go.mod" | grep "wireguard")` From 061ff74bf2440c42ad91910ff2a4fd3111e99ff1 Mon Sep 17 00:00:00 2001 From: bernardkkt Date: Sat, 1 May 2021 21:23:00 +0800 Subject: [PATCH 2/2] Change build path --- build-wg-go.sh | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/build-wg-go.sh b/build-wg-go.sh index f2cb50d..cb3bb9e 100644 --- a/build-wg-go.sh +++ b/build-wg-go.sh @@ -8,4 +8,7 @@ set -e GOPATH=`pwd` go get -v -d golang.zx2c4.com/wireguard # Build -GOPATH=`pwd` GOOS=linux GOARCH=amd64 go build -v -o wireguard-go `dirname $(find . -type f -name "go.mod" | grep "wireguard")` +OLD_PATH=`pwd` +NEW_PATH=`dirname $(find . -type f -name "go.mod" | grep "wireguard")` +cd ${NEW_PATH} +GOPATH=${OLD_PATH} GOOS=linux GOARCH=amd64 go build -v -o "${OLD_PATH}/wireguard-go"