mirror of https://github.com/docker/cli.git
Merge pull request #3517 from crazy-max/fix-version-quad
trim leading 0 for minor in the version quad
This commit is contained in:
commit
b1ce915a3b
|
@ -7,6 +7,10 @@ set -eu
|
||||||
|
|
||||||
# Create version quad for Windows of the form major.minor.patch.build
|
# Create version quad for Windows of the form major.minor.patch.build
|
||||||
VERSION_QUAD=$(printf "%s" "$VERSION" | sed -re 's/^([0-9.]*).*$/\1/' | sed -re 's/\.$//' | sed -re 's/^[0-9]+$/\0\.0/' | sed -re 's/^[0-9]+\.[0-9]+$/\0\.0/' | sed -re 's/^[0-9]+\.[0-9]+\.[0-9]+$/\0\.0/')
|
VERSION_QUAD=$(printf "%s" "$VERSION" | sed -re 's/^([0-9.]*).*$/\1/' | sed -re 's/\.$//' | sed -re 's/^[0-9]+$/\0\.0/' | sed -re 's/^[0-9]+\.[0-9]+$/\0\.0/' | sed -re 's/^[0-9]+\.[0-9]+\.[0-9]+$/\0\.0/')
|
||||||
|
VERSION_MAJOR=$(echo "${VERSION_QUAD:-0}" | cut -d. -f1)
|
||||||
|
VERSION_MINOR=$(echo "${VERSION_QUAD:-0}" | cut -d. -f2)
|
||||||
|
VERSION_PATCH=$(echo "${VERSION_QUAD:-0}" | cut -d. -f3)
|
||||||
|
VERSION_BUILD=$(echo "${VERSION_QUAD:-0}" | cut -d. -f4)
|
||||||
|
|
||||||
# Generate versioninfo.json to be able to create a syso file which contains
|
# Generate versioninfo.json to be able to create a syso file which contains
|
||||||
# Microsoft Windows Version Information and an icon using goversioninfo.
|
# Microsoft Windows Version Information and an icon using goversioninfo.
|
||||||
|
@ -17,10 +21,10 @@ cat > ./cli/winresources/versioninfo.json <<EOL
|
||||||
"FixedFileInfo":
|
"FixedFileInfo":
|
||||||
{
|
{
|
||||||
"FileVersion": {
|
"FileVersion": {
|
||||||
"Major": $(echo "${VERSION_QUAD:-0}" | cut -d. -f1),
|
"Major": ${VERSION_MAJOR},
|
||||||
"Minor": $(echo "${VERSION_QUAD:-0}" | cut -d. -f2),
|
"Minor": ${VERSION_MINOR#0},
|
||||||
"Patch": $(echo "${VERSION_QUAD:-0}" | cut -d. -f3),
|
"Patch": ${VERSION_PATCH},
|
||||||
"Build": $(echo "${VERSION_QUAD:-0}" | cut -d. -f4)
|
"Build": ${VERSION_BUILD}
|
||||||
},
|
},
|
||||||
"FileFlagsMask": "3f",
|
"FileFlagsMask": "3f",
|
||||||
"FileFlags ": "00",
|
"FileFlags ": "00",
|
||||||
|
|
Loading…
Reference in New Issue