|
|
@ -80,6 +80,9 @@ var (
|
|
|
|
|
|
|
|
|
|
|
|
// isWindowsGUI is whether the current binary is the Windows GUI binary.
|
|
|
|
// isWindowsGUI is whether the current binary is the Windows GUI binary.
|
|
|
|
isWindowsGUI bool
|
|
|
|
isWindowsGUI bool
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// majorMinorPatch is the major.minor.patch portion of Short.
|
|
|
|
|
|
|
|
majorMinorPatch string
|
|
|
|
)
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
|
|
func init() {
|
|
|
|
func init() {
|
|
|
@ -89,6 +92,12 @@ func init() {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
func initVersion() {
|
|
|
|
func initVersion() {
|
|
|
|
|
|
|
|
defer func() {
|
|
|
|
|
|
|
|
// Must be run after Short has been initialized, easiest way to do that
|
|
|
|
|
|
|
|
// is a defer.
|
|
|
|
|
|
|
|
majorMinorPatch, _, _ = strings.Cut(Short, "-")
|
|
|
|
|
|
|
|
}()
|
|
|
|
|
|
|
|
|
|
|
|
if Long != "" && Short != "" {
|
|
|
|
if Long != "" && Short != "" {
|
|
|
|
// Built in the recommended way, using build_dist.sh.
|
|
|
|
// Built in the recommended way, using build_dist.sh.
|
|
|
|
return
|
|
|
|
return
|
|
|
@ -98,7 +107,7 @@ func initVersion() {
|
|
|
|
// stamping.
|
|
|
|
// stamping.
|
|
|
|
bi, ok := debug.ReadBuildInfo()
|
|
|
|
bi, ok := debug.ReadBuildInfo()
|
|
|
|
if !ok {
|
|
|
|
if !ok {
|
|
|
|
Long = strings.TrimSpace(tailscaleroot.Version) + "-ERR-BuildInfo"
|
|
|
|
Long = strings.TrimSpace(tailscaleroot.VersionDotTxt) + "-ERR-BuildInfo"
|
|
|
|
Short = Long
|
|
|
|
Short = Long
|
|
|
|
return
|
|
|
|
return
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -126,7 +135,7 @@ func initVersion() {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// Backup path, using Go 1.18's built-in git stamping.
|
|
|
|
// Backup path, using Go 1.18's built-in git stamping.
|
|
|
|
Short = strings.TrimSpace(tailscaleroot.Version) + "-dev" + commitDate
|
|
|
|
Short = strings.TrimSpace(tailscaleroot.VersionDotTxt) + "-dev" + commitDate
|
|
|
|
Long = Short + "-t" + commitHashAbbrev + dirty
|
|
|
|
Long = Short + "-t" + commitHashAbbrev + dirty
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|