From 8218bce9ff72f0a431eb32c26700784beb5d6f49 Mon Sep 17 00:00:00 2001 From: Adam Goldsmith Date: Wed, 20 Jul 2022 15:07:37 -0400 Subject: [PATCH] vcarve-pro-trial-11.0: Make update script a bit more generic --- vcarve-pro-trial-11.0/update.sh | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/vcarve-pro-trial-11.0/update.sh b/vcarve-pro-trial-11.0/update.sh index 49aa1f2..c64f19e 100755 --- a/vcarve-pro-trial-11.0/update.sh +++ b/vcarve-pro-trial-11.0/update.sh @@ -4,10 +4,11 @@ cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" wget -N "https://storage.googleapis.com/vectric_public/VCarveProTrialEdition_Setup.exe" --directory-prefix tools/ -version=$(7z e -so tools/VCarveProTrialEdition_Setup.exe ProductInfo.ini | awk -F= '$1=="product_version" { print $2 }') +file=tools/VCarveProTrialEdition_Setup.exe +version=$(7z e -so $file ProductInfo.ini | awk -F= '$1=="product_version" { print $2 }') major_version=$(awk -F. -v RS='\r\n' '{print $1"."$2}' <<< $version) minor_version=$(awk -F. -v RS='\r\n' '{print $3"."$4}' <<< $version) -checksum=$(sha256sum tools/VCarveProTrialEdition_Setup.exe | awk '{print $1}') +checksum=$(sha256sum $file | awk '{print $1}') if [ "$major_version" != "11.0" ] then @@ -17,5 +18,5 @@ fi echo "Current version for ${PWD##*/}: major=$major_version, minor=$minor_version, checksum=$checksum" -sed -i "s|[^<]*|$minor_version|" vcarve-pro-trial-11.0.nuspec +sed -i "s|[^<]*|$minor_version|" "${PWD##*/}.nuspec" sed -i "/Checksum64/s|=.*|= '$checksum'|" tools/chocolateyInstall.ps1