Skip to content

Commit

Permalink
Fix debian package building when go is preinstalled
Browse files Browse the repository at this point in the history
  • Loading branch information
Sébastien Blaisot committed Oct 16, 2023
1 parent dd79acc commit 5127a11
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions scripts/packaging/buildpackage.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,14 @@

set -euo pipefail

export GOROOT="${GOROOT:-/tmp/go}"
export GOPATH="${GOPATH:-/tmp/goroot}"
export PATH="${GOPATH}/bin:$GOROOT/bin:${PATH}"

if command -v go > /dev/null; then
eval "$(go env)"
export GOROOT GOPATH
else
export GOROOT="${GOROOT:-/tmp/go}"
export GOPATH="${GOPATH:-/tmp/goroot}"
export PATH="${GOPATH}/bin:$GOROOT/bin:${PATH}"
fi

cd "$(dirname $0)/../.."
if [ -f debian/changelog ]; then
Expand Down

0 comments on commit 5127a11

Please sign in to comment.