2022-09-06 11:47:52 -06:00
|
|
|
#!/usr/bin/env bash
|
|
|
|
#
|
|
|
|
# This script assumes a linux environment
|
|
|
|
|
|
|
|
set -e
|
|
|
|
|
2022-09-19 09:08:34 -06:00
|
|
|
echo "*** uBOLite.mv3: Creating extension"
|
2022-09-06 11:47:52 -06:00
|
|
|
|
2022-09-19 09:08:34 -06:00
|
|
|
DES="dist/build/uBOLite.mv3"
|
2022-09-07 08:15:36 -06:00
|
|
|
|
|
|
|
if [ "$1" != "quick" ]; then
|
|
|
|
rm -rf $DES
|
|
|
|
fi
|
|
|
|
|
2022-09-06 11:47:52 -06:00
|
|
|
mkdir -p $DES
|
|
|
|
cd $DES
|
|
|
|
DES=$(pwd)
|
|
|
|
cd - > /dev/null
|
|
|
|
|
2022-09-07 08:15:36 -06:00
|
|
|
mkdir -p $DES/css/fonts
|
|
|
|
mkdir -p $DES/js
|
|
|
|
mkdir -p $DES/img
|
2022-09-06 11:47:52 -06:00
|
|
|
|
2022-09-19 09:08:34 -06:00
|
|
|
echo "*** uBOLite.mv3: Copying common files"
|
2022-09-07 08:15:36 -06:00
|
|
|
cp -R src/css/fonts/* $DES/css/fonts/
|
|
|
|
cp src/css/themes/default.css $DES/css/
|
|
|
|
cp src/css/common.css $DES/css/
|
2022-09-13 15:44:24 -06:00
|
|
|
cp src/css/dashboard-common.css $DES/css/
|
2022-09-07 08:15:36 -06:00
|
|
|
cp src/css/fa-icons.css $DES/css/
|
2022-09-13 15:44:24 -06:00
|
|
|
|
2022-11-12 07:51:22 -07:00
|
|
|
cp src/js/dom.js $DES/js/
|
2022-09-07 08:15:36 -06:00
|
|
|
cp src/js/fa-icons.js $DES/js/
|
2022-09-13 15:44:24 -06:00
|
|
|
cp src/js/i18n.js $DES/js/
|
2022-09-07 08:15:36 -06:00
|
|
|
|
2022-09-06 11:47:52 -06:00
|
|
|
cp LICENSE.txt $DES/
|
|
|
|
|
2022-09-19 09:08:34 -06:00
|
|
|
echo "*** uBOLite.mv3: Copying mv3-specific files"
|
2022-09-07 08:15:36 -06:00
|
|
|
cp platform/mv3/extension/*.html $DES/
|
|
|
|
cp platform/mv3/extension/css/* $DES/css/
|
2022-10-15 11:05:20 -06:00
|
|
|
cp -R platform/mv3/extension/js/* $DES/js/
|
2022-09-07 08:15:36 -06:00
|
|
|
cp platform/mv3/extension/img/* $DES/img/
|
2022-09-13 15:44:24 -06:00
|
|
|
cp -R platform/mv3/extension/_locales $DES/
|
2022-09-07 08:15:36 -06:00
|
|
|
|
|
|
|
if [ "$1" != "quick" ]; then
|
2022-09-19 09:08:34 -06:00
|
|
|
echo "*** uBOLite.mv3: Generating rulesets"
|
2022-09-07 08:15:36 -06:00
|
|
|
TMPDIR=$(mktemp -d)
|
|
|
|
mkdir -p $TMPDIR
|
|
|
|
cp platform/mv3/extension/manifest.json $DES/
|
|
|
|
./tools/make-nodejs.sh $TMPDIR
|
|
|
|
cp platform/mv3/package.json $TMPDIR/
|
|
|
|
cp platform/mv3/*.js $TMPDIR/
|
2022-09-20 06:24:01 -06:00
|
|
|
cp platform/mv3/extension/js/utils.js $TMPDIR/js/
|
2022-09-13 15:44:24 -06:00
|
|
|
cp assets/assets.json $TMPDIR/
|
2022-09-16 13:56:35 -06:00
|
|
|
cp -R platform/mv3/scriptlets $TMPDIR/
|
2022-10-16 10:05:24 -06:00
|
|
|
mkdir -p $TMPDIR/web_accessible_resources
|
|
|
|
cp src/web_accessible_resources/* $TMPDIR/web_accessible_resources/
|
2022-09-07 08:15:36 -06:00
|
|
|
cd $TMPDIR
|
2022-09-15 11:14:08 -06:00
|
|
|
node --no-warnings make-rulesets.js output=$DES
|
2022-09-07 08:15:36 -06:00
|
|
|
cd - > /dev/null
|
|
|
|
rm -rf $TMPDIR
|
|
|
|
fi
|
2022-09-06 11:47:52 -06:00
|
|
|
|
2022-09-19 09:08:34 -06:00
|
|
|
echo "*** uBOLite.mv3: extension ready"
|
2022-09-06 11:47:52 -06:00
|
|
|
echo "Extension location: $DES/"
|
|
|
|
|
2022-09-08 08:24:17 -06:00
|
|
|
if [ "$1" = "full" ]; then
|
2022-09-19 09:08:34 -06:00
|
|
|
echo "*** uBOLite.mv3: Creating webstore package..."
|
|
|
|
PACKAGENAME=uBOLite_$(jq -r .version $DES/manifest.json).mv3.zip
|
2022-09-07 08:23:40 -06:00
|
|
|
TMPDIR=$(mktemp -d)
|
|
|
|
mkdir -p $TMPDIR
|
|
|
|
cp -R $DES/* $TMPDIR/
|
|
|
|
cd $TMPDIR > /dev/null
|
|
|
|
rm log.txt
|
2022-09-15 11:37:39 -06:00
|
|
|
zip $PACKAGENAME -qr ./*
|
2022-09-07 08:23:40 -06:00
|
|
|
cd - > /dev/null
|
2022-09-08 09:44:27 -06:00
|
|
|
cp $TMPDIR/$PACKAGENAME dist/build/
|
2022-09-07 08:23:40 -06:00
|
|
|
rm -rf $TMPDIR
|
2022-09-08 09:21:39 -06:00
|
|
|
echo "Package location: $(pwd)/dist/build/$PACKAGENAME"
|
2022-09-07 08:23:40 -06:00
|
|
|
fi
|