2016-04-03 19:07:46 +02:00
|
|
|
#!/usr/bin/env bash
|
|
|
|
#
|
|
|
|
# This script assumes a linux environment
|
|
|
|
|
|
|
|
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
|
|
|
|
2016-04-03 19:07:46 +02:00
|
|
|
mkdir $DES/thirdparties
|
2021-07-29 01:40:11 +02:00
|
|
|
|
|
|
|
# Use existing uAssets, or git-clone a temporary one
|
|
|
|
if [ -d "../uAssets" ]; then
|
|
|
|
UASSETS=../uAssets
|
|
|
|
else
|
|
|
|
echo "*** ../uAssets not present, git-cloning..."
|
|
|
|
TMPDIR=$(mktemp -d)
|
|
|
|
UASSETS=$TMPDIR/uAssets
|
|
|
|
git clone --depth=1 https://github.com/uBlockOrigin/uAssets.git $UASSETS
|
|
|
|
fi
|
|
|
|
|
|
|
|
cp -R $UASSETS/thirdparties/easylist-downloads.adblockplus.org $DES/thirdparties/
|
|
|
|
cp -R $UASSETS/thirdparties/pgl.yoyo.org $DES/thirdparties/
|
|
|
|
cp -R $UASSETS/thirdparties/publicsuffix.org $DES/thirdparties/
|
|
|
|
cp -R $UASSETS/thirdparties/urlhaus-filter $DES/thirdparties/
|
2016-04-03 19:07:46 +02:00
|
|
|
|
|
|
|
mkdir $DES/ublock
|
2021-07-29 01:40:11 +02:00
|
|
|
cp -R $UASSETS/filters/* $DES/ublock/
|
2017-12-17 15:42:24 +01:00
|
|
|
# Optional filter lists: do not include in package
|
|
|
|
rm $DES/ublock/annoyances.txt
|
2016-04-03 19:07:46 +02:00
|
|
|
|
2021-07-29 01:40:11 +02:00
|
|
|
# Remove temporary git-clone uAssets
|
|
|
|
if [ -n "$TMPDIR" ]; then
|
|
|
|
echo "*** Removing temporary $TMPDIR"
|
|
|
|
rm -rf $TMPDIR
|
|
|
|
fi
|