-
Notifications
You must be signed in to change notification settings - Fork 0
/
build
42 lines (37 loc) · 1.48 KB
/
build
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
30
31
32
33
34
35
36
37
38
39
40
41
42
#!/bin/sh
export VER='1.1.12'
export FULLVER='1.1.12'
export REV=91
export FEATURES='增加对天猫链接的屏蔽;增加对2014世界杯国旗标识的屏蔽'
while getopts ":nd" optname
do
case "$optname" in
"n") COMPRESS=' --nocompress';;
"d") COMPRESS=' --nocompress'; PARAMS=' --flag=DEBUG';;
"?") echo "Unknown option -$OPTARG"; exit 1;;
":") echo "Missing argument value for option -$OPTARG"; exit 1;;
esac
done
# Greasemonkey
printf 'Building Greasemonkey script...'
export CSS=`./compile.pl $PARAMS --flag=GREASEMONKEY settings.css`
export HTML=`./compile.pl $PARAMS --flag=GREASEMONKEY settings.html`
SCRIPT="release/latest/weiboFilter-v${VER}.user.js"
./compile.pl --nocompress head.js > $SCRIPT
printf '\n' >> $SCRIPT
./compile.pl $COMPRESS $PARAMS --flag=GREASEMONKEY weiboFilter.user.js >> $SCRIPT
unset CSS HTML
echo ' done.'
# Chrome
printf 'Building Chrome extension...'
PACKAGE="release/latest/weiboFilter-chrome-v${VER}.zip"
export CSS=`./compile.pl $PARAMS --flag=CHROME settings.css`
export HTML=`./compile.pl $PARAMS --flag=CHROME settings.html`
rm -f release/latest/chrome/*
cp chrome/* release/latest/chrome/
./compile.pl --nocompress -out="release/latest/chrome/manifest.json" chrome/manifest.json
./compile.pl $COMPRESS $PARAMS --out="release/latest/chrome/main.js" chrome/main.js
./compile.pl $COMPRESS $PARAMS --flag=CHROME --out="release/latest/chrome/weiboFilter.js" weiboFilter.user.js
zip -q -j $PACKAGE release/latest/chrome/*
echo ' done.'
unset VER FULLVER REV