-
Notifications
You must be signed in to change notification settings - Fork 1
/
build_new.sh
99 lines (74 loc) · 1.64 KB
/
build_new.sh
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
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
#!/bin/bash
# change this to your local cpbo path, in case cpbo.exe is not in the current dir
cpbo_path="$1"
missionname="TvT_UrbanOps"
islands=(
Altis
Beketov
Chernarus
Chernarus_Summer
Chernarus_winter
Intro
fallujah
fata
mbg_celle2
Porto
Stratis
Sara_dbe1
Shapur_BAF
Takistan
Tanoa
utes
vt5
Woodland_ACR
Zargabad
)
### AS AS USER, DONT EDIT BELOW THIS LINE ###
if [[ ! -f $cpbo_path ]]; then
cpbo_path="./cpbo.exe"
fi
if [[ ! -f $cpbo_path ]]; then
echo "warning: cpbo path not found, will not build pbo files!"
exit 1
fi
VERSION=$(git describe)
echo "Repository Version: $VERSION"
MAINVERSION=$(echo $VERSION | cut -d "-" -f1)
COMMITSBEHIND=$(echo $VERSION | cut -d "-" -f2)
SHORTHASH=$(echo $VERSION | cut -d "-" -f3)
MAJOR=$(echo $MAINVERSION | cut -d "." -f1)
MINOR=$(echo $MAINVERSION | cut -d "." -f2)
BUGFIX=$COMMITSBEHIND
VERSION="$MAJOR.$MINOR.$BUGFIX"
if test "$MAINVERSION" = "$COMMITSBEHIND"
then
VERSION="$MAJOR.$MINOR"
fi
echo "Version-String: $VERSION"
cwd=`pwd`
builddir="$cwd/../tmp-build"
mkdir -p "$builddir"
tmpdir="$builddir/tmpdir"
cp -r ./ "$tmpdir"
rm "$tmpdir/build.sh"
rm "$tmpdir/cpbo.exe"
rm -fr "$tmpdir/.git"
rm "$tmpdir/.gitattributes"
rm "$tmpdir/.gitignore"
echo "building PBO...";
$cpbo_path -y -p "$tmpdir" > /dev/null
echo "done (probably)"
pbofilename="${tmpdir}.pbo"
if [[ ! -f "$pbofilename" ]]; then
echo "örks"
exit 2
fi
echo "copying pbo for different islands..."
for island in "${islands[@]}"; do
cp "$pbofilename" "${builddir}/${missionname}_${VERSION}.${island}.pbo"
done
echo "done. clean up..."
rm -r "$tmpdir"
rm "$pbofilename"
echo "plz see $builddir for pbo files"
sleep 2