forked from minj/foxtrick
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathversion.sh
More file actions
executable file
·30 lines (28 loc) · 748 Bytes
/
version.sh
File metadata and controls
executable file
·30 lines (28 loc) · 748 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
30
#!/bin/sh
#
# Version utility
# version must be in this format: [0-9.]+
#
# Usage:
# - To get version:
# ./version.sh
# - To bump version:
# ./version.sh VERSION
if [ -z $1 ]; then
sed -n -r "/extensions\\.foxtrick\\.prefs\\.version/s/^.+\"([0-9.]+)\".+$/\\1/p" defaults/preferences/foxtrick.js
else
VER="$1"
sed -i -r "/extensions\\.foxtrick\\.prefs\\.version/s|\"[0-9.]+\"|\"$VER\"|" defaults/preferences/foxtrick.js
# Mozilla
if [ -f install.rdf ]; then
sed -i -r "/<em:version>/s|>[0-9.]+<|>$VER<|" install.rdf
fi
# Chrome
if [ -f manifest.json ]; then
sed -i -r "/\"version\"/s|\"[0-9.]+\"|\"$VER\"|" manifest.json
fi
# Safari
if [ -f Info.plist ]; then
sed -i -r "/<!--version-->/s|>[0-9.]+<|>$VER<|" Info.plist
fi
fi