2024-05-25 22:39:15 +02:00
|
|
|
#/bin/bash
|
|
|
|
|
|
|
|
# this is a script file to generate a zip package from this source:
|
|
|
|
cd "$(dirname "$0")"
|
|
|
|
cd ..
|
2024-05-26 01:26:13 +02:00
|
|
|
# now we are at the depot directory
|
|
|
|
# if there is a file named depot.xml, we ask to increase the version with
|
|
|
|
|
|
|
|
read -p "Do you want to update/increase the patch (last) version number? (y/N)" -n 1 -r
|
|
|
|
echo # (optional) move to a new line
|
|
|
|
if [[ $REPLY =~ ^[YyJj]$ ]]
|
|
|
|
then
|
|
|
|
echo "Updating the version"
|
|
|
|
patch=`xmllint -xpath 'string(//*[local-name()="version"])' depot.xml | rev | cut -f1 -d. | rev`
|
|
|
|
echo "$patch"
|
|
|
|
patch=$((patch+1))
|
|
|
|
echo "$patch"
|
|
|
|
version=`xmllint -xpath 'string(//*[local-name()="version"])' depot.xml`
|
|
|
|
major=`echo "$version" | cut -f1 -d.`
|
|
|
|
minor=`echo "$version" | cut -f2 -d.`
|
|
|
|
patch=`echo "$version" | cut -f3 -d.`
|
|
|
|
echo "$version"
|
|
|
|
patch=$((patch+1))
|
|
|
|
minor=$((minor))
|
|
|
|
newversion="$major.$minor.$patch"
|
|
|
|
echo "$newversion"
|
|
|
|
|
|
|
|
#xml=$(xmllint --shell depot.xml << EOF
|
|
|
|
#-xpath 'string(//*[local-name()="version"]'
|
|
|
|
#set 1.2.3
|
|
|
|
#save -
|
|
|
|
#EOF
|
|
|
|
#)
|
|
|
|
xmllint --shell depot.xml << EOF
|
|
|
|
cd extension/version
|
|
|
|
set $newversion
|
|
|
|
save
|
|
|
|
EOF
|
|
|
|
|
|
|
|
else
|
|
|
|
echo "Keep the version"
|
|
|
|
fi
|
2024-05-25 22:39:15 +02:00
|
|
|
mkdir -p zip
|
2024-05-26 01:26:13 +02:00
|
|
|
zip -q -r zip/depot.zip * -x .git/\* -x script/\* -x zip/\*
|
|
|
|
|