2020-02-05 22:16:58 +00:00
|
|
|
redo-ifchange long.txt short.txt
|
|
|
|
read -r long <long.txt
|
|
|
|
read -r short <short.txt
|
|
|
|
|
|
|
|
# get it into "major.minor.patch" format
|
|
|
|
ver=$(echo "$ver" | sed -e 's/-/./')
|
|
|
|
|
2020-09-23 03:29:34 +00:00
|
|
|
# winres is the MAJOR,MINOR,BUILD,REVISION 4-tuple used to identify
|
|
|
|
# the version of Windows binaries. We always set REVISION to 0, which
|
|
|
|
# seems to be how you map SemVer.
|
|
|
|
winres=$(echo "$short,0" | sed -e 's/\./,/g')
|
|
|
|
|
2020-02-05 22:16:58 +00:00
|
|
|
(
|
|
|
|
printf '#define TAILSCALE_VERSION_LONG "%s"\n' "$long"
|
|
|
|
printf '#define TAILSCALE_VERSION_SHORT "%s"\n' "$short"
|
2020-09-23 03:29:34 +00:00
|
|
|
printf '#define TAILSCALE_VERSION_WIN_RES %s\n' "$winres"
|
2020-02-05 22:16:58 +00:00
|
|
|
) >$3
|