-
Notifications
You must be signed in to change notification settings - Fork 16
/
changeVersion
executable file
·30 lines (25 loc) · 1 KB
/
changeVersion
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
#!/bin/bash
WDIR=`dirname $0`
FF=$WDIR/firefox/missinge/package.json
FFpt=$WDIR/firefox/missinge/data/version
CH=$WDIR/chrome/manifest.json
SF=$WDIR/missinge.safariextension/Info.plist
SFst=$WDIR/missinge.safariextension/Settings.plist
INDEX=$WDIR/site/index.html
sed -e 's/"version": "[^"]*"/"version": "'$1'"/' $FF > $FF.new
mv $FF.new $FF
sed -e 's/"version": "[^"]*"/"version": "'$1'"/' $CH > $CH.new
mv $CH.new $CH
sed -E -e '/CFBundleShortVersionString<\/key>/{
N
s/(CFBundleShortVersionString<\/key>[^<]*<string>)[^<]*/\1'$1'/
}' $SF > $SF.new
sed -E -e '/CFBundleVersion<\/key>/{
N
s/(CFBundleVersion<\/key>[^<]*<string>)[^<]*/\1'$2'/
}' $SF.new > $SF
rm $SF.new
sed -e 's/<string>MISSINGEVERSION<\/string>/<string>'$1'<\/string>/' $SFst.template > $SFst
sed -e 's/<div version="[^"]*" id="versioncheck">/<div version="'$1'" id="versioncheck">/' $INDEX > $INDEX.new
sed -e 's/<a href="faq#update">Update to v[0-9\.]* now<\/a>/<a href="faq#update">Update to v'$1' now<\/a>/' $INDEX.new > $INDEX
rm $INDEX.new