1
0
mirror of https://github.com/gorhill/uBlock.git synced 2024-07-08 04:49:12 +02:00

[mv3] Support the tagname being set externally

This commit is contained in:
Raymond Hill 2023-09-09 09:47:38 -04:00
parent b2d8c9a0ba
commit 1db17ac4bf
No known key found for this signature in database
GPG Key ID: 25E1490B761470C2

View File

@ -3,6 +3,7 @@
# This script assumes a linux environment
set -e
shopt -s extglob
echo "*** uBOLite.mv3: Creating extension"
@ -26,6 +27,11 @@ for i in "$@"; do
PLATFORM="chromium"
shift # past argument=value
;;
(uBOLite_+([0-9]).+([0-9]).+([0-9]).+([0-9]))
TAGNAME="$i"
FULL="yes"
shift # past argument=value
;;
esac
done
@ -119,7 +125,14 @@ if [ "$FULL" = "yes" ]; then
EXTENSION="xpi"
fi
echo "*** uBOLite.mv3: Creating publishable package..."
PACKAGENAME="uBOLite_$(jq -r .version $DES/manifest.json).$PLATFORM.mv3.$EXTENSION"
if [ -z "$TAGNAME" ]; then
TAGNAME="uBOLite_$(jq -r .version $DES/manifest.json)"
else
tmp=$(mktemp)
jq --arg tagname "$TAGNAME" '.version = $tagname' "$DES/manifest.json" > "$tmp" \
&& mv "$tmp" "$DES/manifest.json"
fi
PACKAGENAME="$TAGNAME.$PLATFORM.mv3.$EXTENSION"
TMPDIR=$(mktemp -d)
mkdir -p $TMPDIR
cp -R $DES/* $TMPDIR/