-
Notifications
You must be signed in to change notification settings - Fork 16
/
changeVersion
executable file
·37 lines (30 loc) · 1.25 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
31
32
33
34
35
36
37
#!/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
UPDATE=$WDIR/site/update.php
CURRVER=$WDIR/site/currentVersion.js
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/<span id="download_version">Version [0-9\.]*<\/span>/<span id="download_version">Version '$1'<\/span>/' $INDEX.new > $INDEX
rm $INDEX.new
sed -e 's/<div version="[^"]*" id="versioncheck"/<div version="'$1'" id="versioncheck"/' $UPDATE > $UPDATE.new
mv $UPDATE.new $UPDATE
echo "var currentVersion=\"$1\";" > $CURRVER