1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/diagramsnet_ynh.git synced 2024-09-03 18:26:33 +02:00

Fix updater

This commit is contained in:
tituspijean 2022-05-12 18:46:26 +02:00 committed by GitHub
parent 336b5ae067
commit 322db937ec
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -69,26 +69,19 @@ src="app"
tempdir="$(mktemp -d)"
# Download sources and calculate checksum
filename=${asset_url##*/}
filename="temp.tar.gz"
curl --silent -4 -L $asset_url -o "$tempdir/$filename"
checksum=$(sha256sum "$tempdir/$filename" | head -c 64)
# Delete temporary directory
rm -rf $tempdir
# Get extension
if [[ $filename == *.tar.gz ]]; then
extension=tar.gz
else
extension=${filename##*.}
fi
# Rewrite source file
cat <<EOT > conf/$src.src
SOURCE_URL=$asset_url
SOURCE_SUM=$checksum
SOURCE_SUM_PRG=sha256sum
SOURCE_FORMAT=$extension
SOURCE_FORMAT=tar.gz
SOURCE_IN_SUBDIR=true
SOURCE_FILENAME=
EOT