2017-06-12 12:15:09 -07:00
|
|
|
#!/bin/bash
|
2017-04-27 16:53:51 -07:00
|
|
|
DIST="dist"
|
2017-08-17 19:11:27 -07:00
|
|
|
BROWSERS=("firefox" "opera" "chrome")
|
2017-04-27 16:53:51 -07:00
|
|
|
|
|
|
|
for i in "${BROWSERS[@]}"
|
|
|
|
do
|
2017-05-15 15:57:19 -07:00
|
|
|
DIR=$DIST/$i
|
2017-04-27 16:53:51 -07:00
|
|
|
|
2017-05-15 15:57:19 -07:00
|
|
|
mkdir -p $DIR/src
|
2017-04-27 16:53:51 -07:00
|
|
|
|
2017-05-15 15:57:19 -07:00
|
|
|
rm -rf "$DIR/*"
|
|
|
|
|
|
|
|
echo $DIR/src
|
|
|
|
cp -r src/* $DIR/src
|
2017-06-12 12:15:09 -07:00
|
|
|
|
|
|
|
file="extension.zip"
|
2017-10-29 14:18:52 -07:00
|
|
|
if [ $i == "firefox" ]; then
|
|
|
|
file="extension.xpi"
|
2017-10-30 12:36:27 -07:00
|
|
|
else
|
2017-10-29 14:18:52 -07:00
|
|
|
perl -0pe 's/,\s+"applications": \{(.*?\}){2}//s'\
|
2017-10-30 12:36:27 -07:00
|
|
|
$DIR/src/manifest.json > $DIR/src/_manifest.json
|
2017-10-29 14:37:36 -07:00
|
|
|
rm $DIR/src/manifest.json
|
2017-10-30 12:36:27 -07:00
|
|
|
mv $DIR/src/_manifest.json $DIR/src/manifest.json
|
2017-06-12 12:15:09 -07:00
|
|
|
fi
|
|
|
|
|
2017-08-15 18:52:58 -07:00
|
|
|
zip -j $DIR/$file $DIR/src/*
|
2017-04-27 16:53:51 -07:00
|
|
|
done
|