forked from OpenRCT2/objects
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpackage
executable file
·35 lines (30 loc) · 857 Bytes
/
package
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
#!/bin/bash
set -e
outDir="artifacts/objects"
echo -e "\033[0;36mRe-creating artifacts directory...\033[0m"
rm -rf "artifacts"
mkdir -p "$outDir"
echo -e "\033[0;36mCopying objects...\033[0m"
pushd objects > /dev/null
cp -r "official" "rct1" "rct2" "rct2ww" "rct2tt" "../$outDir"
popd > /dev/null
echo -e "\033[0;36mCreating .parkobj files...\033[0m"
for i in $(find "$outDir" -type d);
do
objectFile="$i/object.json"
if [ -f "$objectFile" ]; then
objName=$(basename "$i")
src=$i
dst="$src.parkobj"
echo " $objName.parkobj"
pushd "$src" > /dev/null
zip -qr9 "../$objName.parkobj" *
popd > /dev/null
rm -rf "$src"
fi
done;
echo -e "\033[0;36mCreating final archive...\033[0m"
pushd "$outDir" > /dev/null
zip -qr9 "../objects.zip" *
popd > /dev/null
rm -rf "$outDir"