2021-07-31 20:49:32 +02:00
|
|
|
#!/usr/bin/env bash
|
2016-04-03 19:07:46 +02:00
|
|
|
#
|
|
|
|
# This script assumes a linux environment
|
|
|
|
|
2021-07-31 23:34:25 +02:00
|
|
|
set -e
|
|
|
|
|
2016-04-03 19:07:46 +02:00
|
|
|
DES=$1/assets
|
|
|
|
|
2021-07-29 01:40:11 +02:00
|
|
|
echo "*** Packaging assets in $DES... "
|
2016-04-03 20:25:56 +02:00
|
|
|
|
2016-04-03 19:07:46 +02:00
|
|
|
rm -rf $DES
|
2019-07-06 18:36:28 +02:00
|
|
|
cp -R ./assets $DES/
|
2019-02-15 22:18:03 +01:00
|
|
|
|
2023-05-05 01:20:18 +02:00
|
|
|
VERSION=$(cat ./dist/version)
|
|
|
|
if [[ "$VERSION" =~ ^[0-9]+\.[0-9]+\.[0-9]+$ ]]; then
|
|
|
|
echo "*** Removing $DES/assets.dev.json"
|
|
|
|
rm $DES/assets.dev.json
|
|
|
|
else
|
|
|
|
echo "*** Removing $DES/assets.json"
|
|
|
|
rm $DES/assets.json
|
|
|
|
fi
|
|
|
|
|
2016-04-03 19:07:46 +02:00
|
|
|
mkdir $DES/thirdparties
|
2021-07-29 01:40:11 +02:00
|
|
|
|
2022-11-14 15:50:53 +01:00
|
|
|
ASSETS_MAIN=dist/build/uAssets/main
|
|
|
|
ASSETS_PROD=dist/build/uAssets/prod
|
2021-07-29 01:40:11 +02:00
|
|
|
|
2022-11-14 15:50:53 +01:00
|
|
|
cp -R $ASSETS_MAIN/thirdparties/pgl.yoyo.org $DES/thirdparties/
|
|
|
|
cp -R $ASSETS_MAIN/thirdparties/publicsuffix.org $DES/thirdparties/
|
|
|
|
cp -R $ASSETS_MAIN/thirdparties/urlhaus-filter $DES/thirdparties/
|
|
|
|
|
|
|
|
mkdir -p $DES/thirdparties/easylist
|
2023-04-27 19:22:15 +02:00
|
|
|
cp $ASSETS_PROD/thirdparties/easylist.txt $DES/thirdparties/easylist/
|
|
|
|
cp $ASSETS_PROD/thirdparties/easyprivacy.txt $DES/thirdparties/easylist/
|
2016-04-03 19:07:46 +02:00
|
|
|
|
|
|
|
mkdir $DES/ublock
|
2023-04-28 23:02:51 +02:00
|
|
|
cp $ASSETS_PROD/filters/badlists.txt $DES/ublock/badlists.txt
|
2023-10-30 04:38:54 +01:00
|
|
|
cp $ASSETS_PROD/filters/badware.min.txt $DES/ublock/badware.min.txt
|
2023-04-28 23:02:51 +02:00
|
|
|
cp $ASSETS_PROD/filters/filters.min.txt $DES/ublock/filters.min.txt
|
|
|
|
cp $ASSETS_PROD/filters/privacy.min.txt $DES/ublock/privacy.min.txt
|
2023-10-30 04:38:54 +01:00
|
|
|
cp $ASSETS_PROD/filters/quick-fixes.min.txt $DES/ublock/quick-fixes.min.txt
|
|
|
|
cp $ASSETS_PROD/filters/unbreak.min.txt $DES/ublock/unbreak.min.txt
|