#!/usr/bin/env sh # # Runs `go build` with flags configured for binary distribution. All # it does differently from `go build` is burn git commit and version # information into the binaries, so that we can track down user # issues. # # If you're packaging Tailscale for a distro, please consider using # this script, or executing equivalent commands in your # distro-specific build system. set -eu IFS=".$IFS" read -r major minor patch /dev/null; then patch="$change_count" change_suffix="" elif [ "$change_count" != "0" ]; then change_suffix="-$change_count" else change_suffix="" fi long_suffix="$change_suffix-t$short_hash" MINOR="$major.$minor" SHORT="$MINOR.$patch" LONG="${SHORT}$long_suffix" GIT_HASH="$git_hash" if [ "$1" = "shellvars" ]; then cat <