burlesco/build.sh

28 lines
545 B
Bash
Raw Normal View History

#!/bin/bash
2017-04-27 16:53:51 -07:00
DIST="dist"
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
file="extension.zip"
if [ $i == "firefox" ]; then
file="extension.xpi"
elif [ $i == "chrome" ]; then
perl -0pe 's/,\s+"applications": \{(.*?\}){2}//s'\
$DIR/src/manifest.json > $DIR/src/manifest-chrome.json
rm $DIR/src/manifest.json
mv $DIR/src/manifest-chrome.json $DIR/src/manifest.json
fi
2017-08-15 18:52:58 -07:00
zip -j $DIR/$file $DIR/src/*
2017-04-27 16:53:51 -07:00
done