2024-04-28 11:14:29 -04:00
|
|
|
#!/bin/bash
|
|
|
|
|
2024-10-16 15:00:58 -04:00
|
|
|
if [ -z "$1" ]
|
|
|
|
then
|
|
|
|
echo "Usage: $0 NEW_EXE"
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
file="$1"
|
2024-04-28 11:14:29 -04:00
|
|
|
|
2024-10-16 15:00:58 -04:00
|
|
|
version=$(7z e -so $file ProductInfo.ini | awk -F= '$1=="product_version" { print $2 }')
|
2024-04-28 11:14:29 -04:00
|
|
|
major_version=$(awk -F. -v RS='\r\n' '{print $1"."$2}' <<< $version)
|
|
|
|
minor_version=$(awk -F. -v RS='\r\n' '{print $3"."$4}' <<< $version)
|
2024-10-16 15:00:58 -04:00
|
|
|
checksum=$(sha256sum $file | awk '{print $1}')
|
2024-04-28 11:14:29 -04:00
|
|
|
|
2024-07-15 18:35:17 -04:00
|
|
|
if [ "$major_version" != "12.0" ]
|
2024-04-28 11:14:29 -04:00
|
|
|
then
|
|
|
|
echo "Major version update! This probably won't really work well."
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
2024-10-16 15:00:58 -04:00
|
|
|
cd -- "$( dirname -- "${BASH_SOURCE[0]}" )"
|
2024-04-28 11:14:29 -04:00
|
|
|
echo "Current version for ${PWD##*/}: major=$major_version, minor=$minor_version, checksum=$checksum"
|
|
|
|
|
|
|
|
sed -i "s|<version>[^<]*</version>|<version>$minor_version</version>|" "${PWD##*/}.nuspec"
|
|
|
|
sed -i "/File64/s|[^\\]*$|${file##*/}'|" tools/chocolateyInstall.ps1
|
|
|
|
sed -i "/Checksum64/s|=.*|= '$checksum'|" tools/chocolateyInstall.ps1
|