Add update script for chitubox
This commit is contained in:
parent
5e8974e736
commit
d7e9cae7f8
23
chitubox/update.sh
Executable file
23
chitubox/update.sh
Executable file
@ -0,0 +1,23 @@
|
||||
#!/bin/bash
|
||||
|
||||
cd -- "$( dirname -- "${BASH_SOURCE[0]}" )"
|
||||
|
||||
file="$1"
|
||||
if [ -z "$1" ]
|
||||
then
|
||||
echo "Usage: $0 FILE"
|
||||
exit 1
|
||||
elif [ ! -f "$1" ]
|
||||
then
|
||||
echo "File '$1' not found"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
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
|
Loading…
Reference in New Issue
Block a user