[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
1 changed files with 14 additions and 1 deletions

View File

@ -3,6 +3,7 @@
# This script assumes a linux environment # This script assumes a linux environment
set -e set -e
shopt -s extglob
echo "*** uBOLite.mv3: Creating extension" echo "*** uBOLite.mv3: Creating extension"
@ -26,6 +27,11 @@ for i in "$@"; do
PLATFORM="chromium" PLATFORM="chromium"
shift # past argument=value shift # past argument=value
;; ;;
(uBOLite_+([0-9]).+([0-9]).+([0-9]).+([0-9]))
TAGNAME="$i"
FULL="yes"
shift # past argument=value
;;
esac esac
done done
@ -119,7 +125,14 @@ if [ "$FULL" = "yes" ]; then
EXTENSION="xpi" EXTENSION="xpi"
fi fi
echo "*** uBOLite.mv3: Creating publishable package..." 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) TMPDIR=$(mktemp -d)
mkdir -p $TMPDIR mkdir -p $TMPDIR
cp -R $DES/* $TMPDIR/ cp -R $DES/* $TMPDIR/