-
Notifications
You must be signed in to change notification settings - Fork 18
/
version
executable file
·67 lines (57 loc) · 1.42 KB
/
version
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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
#!/bin/bash
#
# Faust project
# version management tool
#
if [ $# -ne 1 ]
then
echo "FaustLive version management utility"
echo "usage: version version_num"
echo " version_num format: n.n.n"
exit 1
fi
function major {
echo $1 | sed 's/\..*//'
}
function minor {
echo $1 | sed 's/[0-9]*\.\([0-9]*\)\..*/\1/'
}
function patch {
echo $1 | sed 's/[0-9]*\.[0-9]*\.\([0-9]*\)/\1/'
}
function winVer {
echo $1 | sed "s/\./,$2/g"
}
function rcUpdate {
sed "s/FILEVERSION[ ].*/FILEVERSION $2/" $1 | \
sed "s/PRODUCTVERSION[ ].*/PRODUCTVERSION $2/" | \
sed "s/VALUE \"FileVersion\"..*/VALUE \"FileVersion\", \"$3\"/" | \
sed "s/VALUE \"ProductVersion\"..*/VALUE \"ProductVersion\", \"$3\"/"
}
ROOT=.
VERSION=$1
MAJOR=$(major $VERSION)
MINOR=$(minor $VERSION)
PATCH=$(patch $VERSION)
WINVERS=$(winVer $VERSION)",0"
WINVERS2=$(winVer $VERSION " ")", 0"
if [ -d Build ]
then
echo "moving version number to $VERSION"
else
echo "this script must be called from the FaustLive project root directory"
exit 1
fi
VERS=$ROOT/version.txt
echo " updating $VERS"
echo $VERSION > $VERS
FLRC=$ROOT/Build/rsrc/FaustLive.rc
echo " updating $FLRC"
rcUpdate $FLRC $WINVERS "$WINVERS2" > TMP$$
mv -f TMP$$ $FLRC
FLPL=$ROOT/Build/rsrc/FaustLiveInfo.plist
echo " updating $FLPL"
sed -e "s/>[1-9][0-9]*\.[0-9]*\.[0-9]*</>$VERSION</" $FLPL > TMP$$
mv -f TMP$$ $FLPL
echo "### You need to recompile FaustLive for the change to take effect."
exit 0