Add update script for chitubox

This commit is contained in:
Adam Goldsmith 2022-10-28 00:31:12 -04:00
parent 5e8974e736
commit f099f93ba6

13
chitubox/update.sh Executable file
View File

@ -0,0 +1,13 @@
#!/bin/bash
cd -- "$( dirname -- "${BASH_SOURCE[0]}" )"
file="$1"
version=$(grep -oP '\d\.\d\.\d' <<< "$file")
checksum=$(sha256sum $file | awk '{print $1}')
echo "New version for ${PWD##*/}: version=$version, checksum=$checksum"
sed -i "s|<version>[^<]*</version>|<version>$version</version>|" "${PWD##*/}.nuspec"
sed -i "/File64/s|[^\\]*$|${file##*/}'|" tools/chocolateyInstall.ps1
sed -i "/Checksum64/s|=.*|= '$checksum'|" tools/chocolateyInstall.ps1