Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

build: try creating the go bin directory #19862

Merged
merged 4 commits into from
Apr 17, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions changelog/19862.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
```release-note:improvement
build: Prefer GOBIN when set over GOPATH/bin when building the binary
```
8 changes: 5 additions & 3 deletions scripts/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -50,11 +50,13 @@ ${GO_CMD} build \

# Move all the compiled things to the $GOPATH/bin
OLDIFS=$IFS
IFS=: MAIN_GOPATH=($GOPATH)
IFS=: FIRST=($GOPATH) BIN_PATH=${GOBIN:-${FIRST}/bin}
IFS=$OLDIFS

rm -f ${MAIN_GOPATH}/bin/vault
cp bin/vault ${MAIN_GOPATH}/bin/
# Ensure the go bin folder exists
mkdir -p ${BIN_PATH}
robmonte marked this conversation as resolved.
Show resolved Hide resolved
rm -f ${BIN_PATH}/vault
cp bin/vault ${BIN_PATH}

# Done!
echo
Expand Down