-
Notifications
You must be signed in to change notification settings - Fork 5
/
b
executable file
·75 lines (66 loc) · 1.31 KB
/
b
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
68
69
70
71
72
73
74
75
#!/bin/sh
TARGET='SSH Tunnel Manager'
TYPE=app
args=`getopt bsud $*`
set -- $args
for i
do
case "$i"
in
-b)
build=1;
shift;;
-s)
stuff=1;
shift;;
-u)
up=1;
shift;;
-d)
dmg=1;
shift;;
esac
done
if [ -n "$build" ]
then
/Developer/tools/agvtool bump -all
VERSION=`/Developer/tools/agvtool vers -terse`
TOTAL=`wc -l Info.plist | xargs | cut -d" " -f 1`
LINE=`grep -n CFBundleVersion Info.plist |cut -d':' -f1`
head -${LINE} Info.plist > Info.plist.tmp
echo " <string>$VERSION</string>" >> Info.plist.tmp
TAIL=$(( $TOTAL - $LINE - 1 ))
tail -${TAIL} Info.plist >> Info.plist.tmp
mv Info.plist.tmp Info.plist
xcodebuild -target "$TARGET" -buildstyle Deployment
fi
VERSION=`/Developer/tools/agvtool vers -terse`
HEX=`echo "obase=16; $VERSION"|bc`
FILENAME="build/$TARGET.$TYPE-$HEX"
DMGNAME="DMG/$TARGET.dmg"
if [ -n "$dmg" ]
then
if [ -f "DMG/$TARGET.dmg" ]; then rm -f "DMG/$TARGET.dmg"; fi
hdiutil convert -format UDZO -o "DMG/$TARGET.dmg" "DMG/$TARGET-rw.dmg"
fi
if [ -n "$stuff" ]
then
if [ -n "$dmg" ]
then
FN=$DMGNAME
RES="DMG/$TARGET.dmg"
else
FN=$FILENAME
RES="build/BuiltProducts/$TARGET.$TYPE"
fi
if [ -e $FN ]
then
rm -f $FN
fi
stuff -n $FN "$RES"
fi
if [ -n "$up" ]
then
scp $FILENAME [email protected]:
echo http://www.tynsoe.org/`basename $FILENAME`
fi