Skip to content

Commit

Permalink
ease target static build
Browse files Browse the repository at this point in the history
  • Loading branch information
ariary committed Oct 23, 2023
1 parent 1772905 commit 7681bd7
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion build-static.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,11 @@ if [[ $# -ne 1 ]]; then
exit 92
fi

EXENAME="tacos"
TARGET=$(go tool dist list|gum filter --placeholder="choose target os & arch")

export GOOS=$(echo $TARGET|cut -f1 -d '/')
export GOARCH=$(echo $TARGET|cut -f2 -d '/')
echo "build ${EXENAME} in ${PWD}"
export REMOTE=$1
CGO_ENABLED=0 go build -ldflags "-X 'main.Remote=${REMOTE}'" cmd/tacos/tacos.go
CGO_ENABLED=0 go build -ldflags "-X 'main.Remote=${REMOTE}'" -o ${EXENAME} cmd/tacos/tacos.go

0 comments on commit 7681bd7

Please sign in to comment.