From 1db17ac4bf0f41214382de0992fd40d262d25a1c Mon Sep 17 00:00:00 2001 From: Raymond Hill Date: Sat, 9 Sep 2023 09:47:38 -0400 Subject: [PATCH] [mv3] Support the tagname being set externally --- tools/make-mv3.sh | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/tools/make-mv3.sh b/tools/make-mv3.sh index 9f0927c1b..c7bb75a05 100755 --- a/tools/make-mv3.sh +++ b/tools/make-mv3.sh @@ -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/