-
Notifications
You must be signed in to change notification settings - Fork 10
Expand file tree
/
Copy pathpackage.sh
More file actions
executable file
·30 lines (23 loc) · 809 Bytes
/
package.sh
File metadata and controls
executable file
·30 lines (23 loc) · 809 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
#!/bin/sh
set -e
EXTENSION=redirectify
SRC=src
# Set working directory to location of this script
cd $(dirname $(greadlink -m "$0" 2> /dev/null || readlink -m "$0" 2> /dev/null || echo "$0"))
VERSION=$(grep '"version":' "$SRC"/manifest.json | sed 's/.*"\([0-9.]*\)".*/\1/')
OUT="$EXTENSION"-"$VERSION"
# Create .xpi zip file for firefox:
rm -f "$OUT"
cd "$SRC"
zip -r -FS ../"$OUT".xpi *
echo Created for firefox: "$OUT".xpi
# Create .zip file for chrome, with COMMENTED OUT how I used to remove some
# RULES that caused problems:
mkdir -p "../tmp_chrome_version"
for a in * ; do
#cat $a | sed -e '/acm.org/d' -e '/semanticscholar/d' > "../tmp_chrome_version/$a"
cat $a > "../tmp_chrome_version/$a"
done
cd "../tmp_chrome_version"
zip -r -FS ../"$OUT".zip *
echo Created for chrome: "$OUT".zip