Rename ZIP file according to module version

This commit is contained in:
Benoit Vianin 2025-10-17 10:13:35 +00:00
parent 5e86e16455
commit 0484898601
1 changed files with 11 additions and 1 deletions

View File

@ -1,5 +1,9 @@
#!/bin/bash
# Extract version of the module
file=$(pwd)"/core/modules/modSwissqr.class.php"
version=$(grep -oE '[0-9]+\.[0-9]+\.[0-9]+' "$file" 2>/dev/null)
docker run --rm --interactive --tty --volume ./includes:/app composer update --ignore-platform-req=ext-bcmath
# Clean up vendor directory
@ -33,4 +37,10 @@ cd ..
if [ -f swissqr.zip ]; then
rm swissqr.zip
fi
zip -r swissqr.zip swissqr -x "swissqr/.git*" "swissqr/build/*"
# Rename ZIP file
if [ -f swissqr.zip ]; then
mv "swissqr.zip" "swissqr-${version}.zip"
fi