2015-09-22 19:29:26 +02:00
|
|
|
#!/usr/bin/env bash
|
2014-10-17 21:44:19 +02:00
|
|
|
#
|
|
|
|
# This script assumes a linux environment
|
|
|
|
|
2015-04-09 13:29:07 +02:00
|
|
|
echo "*** uBlock0.chromium: Creating web store package"
|
|
|
|
echo "*** uBlock0.chromium: Copying files"
|
2014-12-18 10:47:14 +01:00
|
|
|
|
2017-10-01 16:28:33 +02:00
|
|
|
DES=dist/build/uBlock0.chromium
|
2015-02-05 23:13:39 +01:00
|
|
|
rm -rf $DES
|
2014-11-16 03:21:13 +01:00
|
|
|
mkdir -p $DES
|
2014-12-18 10:47:14 +01:00
|
|
|
|
2016-06-09 18:32:00 +02:00
|
|
|
bash ./tools/make-assets.sh $DES
|
2016-04-03 19:07:46 +02:00
|
|
|
|
|
|
|
cp -R src/css $DES/
|
|
|
|
cp -R src/img $DES/
|
|
|
|
cp -R src/js $DES/
|
|
|
|
cp -R src/lib $DES/
|
|
|
|
cp -R src/_locales $DES/
|
|
|
|
cp src/*.html $DES/
|
|
|
|
cp platform/chromium/*.js $DES/js/
|
2015-02-06 16:30:22 +01:00
|
|
|
cp platform/chromium/*.html $DES/
|
2015-10-21 17:53:03 +02:00
|
|
|
cp platform/chromium/*.json $DES/
|
2016-04-03 19:07:46 +02:00
|
|
|
cp LICENSE.txt $DES/
|
2014-12-18 10:47:14 +01:00
|
|
|
|
2017-10-24 18:40:58 +02:00
|
|
|
echo "*** uBlock0.chromium: concatenating content scripts"
|
2018-04-26 17:36:22 +02:00
|
|
|
cat $DES/js/vapi-usercss.js > /tmp/contentscript.js
|
2018-04-12 18:17:38 +02:00
|
|
|
echo >> /tmp/contentscript.js
|
|
|
|
grep -v "^'use strict';$" $DES/js/vapi-usercss.real.js >> /tmp/contentscript.js
|
2017-10-24 18:40:58 +02:00
|
|
|
echo >> /tmp/contentscript.js
|
2018-04-26 17:36:22 +02:00
|
|
|
grep -v "^'use strict';$" $DES/js/vapi-usercss.pseudo.js >> /tmp/contentscript.js
|
|
|
|
echo >> /tmp/contentscript.js
|
2017-10-24 18:40:58 +02:00
|
|
|
grep -v "^'use strict';$" $DES/js/contentscript.js >> /tmp/contentscript.js
|
|
|
|
mv /tmp/contentscript.js $DES/js/contentscript.js
|
2018-04-26 17:36:22 +02:00
|
|
|
rm $DES/js/vapi-usercss.js
|
2018-04-12 18:17:38 +02:00
|
|
|
rm $DES/js/vapi-usercss.real.js
|
2018-04-26 17:36:22 +02:00
|
|
|
rm $DES/js/vapi-usercss.pseudo.js
|
2017-10-24 18:40:58 +02:00
|
|
|
|
2017-11-10 17:36:55 +01:00
|
|
|
# Chrome store-specific
|
2018-02-15 23:25:38 +01:00
|
|
|
cp -R $DES/_locales/nb $DES/_locales/no
|
|
|
|
|
|
|
|
echo "*** uBlock0.chromium: Generating web accessible resources..."
|
|
|
|
cp -R src/web_accessible_resources $DES/
|
|
|
|
python3 tools/import-war.py $DES/
|
2017-11-10 17:36:55 +01:00
|
|
|
|
2017-10-01 16:28:33 +02:00
|
|
|
echo "*** uBlock0.chromium: Generating meta..."
|
|
|
|
python tools/make-chromium-meta.py $DES/
|
|
|
|
|
2015-01-14 08:51:16 +01:00
|
|
|
if [ "$1" = all ]; then
|
2015-04-09 13:29:07 +02:00
|
|
|
echo "*** uBlock0.chromium: Creating package..."
|
2016-04-04 00:06:19 +02:00
|
|
|
pushd $(dirname $DES/) > /dev/null
|
2015-04-09 13:29:07 +02:00
|
|
|
zip uBlock0.chromium.zip -qr $(basename $DES/)/*
|
2016-04-04 00:06:19 +02:00
|
|
|
popd > /dev/null
|
2015-01-14 08:51:16 +01:00
|
|
|
fi
|
|
|
|
|
2015-04-09 13:29:07 +02:00
|
|
|
echo "*** uBlock0.chromium: Package done."
|