File: export.sh

package info (click to toggle)
openrct2-objects 1.3.7%2Bdfsg-1
  • links: PTS, VCS
  • area: contrib
  • in suites: bookworm
  • size: 15,956 kB
  • sloc: python: 305; sh: 71; makefile: 25
file content (42 lines) | stat: -rwxr-xr-x 866 bytes parent folder | download | duplicates (3)
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
#!/bin/bash
# Build objexport and export objects to json files

echo "Export objects"
if [ $# -ne 2 ]; then
    echo "Usage: export <objdata path> <output directory>"
    exit 1
fi
objdata=$1
outputdir=$2

function checkapp()
{
    which $1 &> /dev/null
    if [ $? -ne 0 ]; then
        echo -e "\033[0;31m$1 not found"
        exit
    fi
}

# Check for required apps
checkapp mono
checkapp nuget
checkapp xbuild
checkapp fsharpc

# Build objexport
pushd tools/objexport
    echo -e "\e[36mBuilding objexport"
    nuget restore > /dev/null
    if [ $? -ne 0 ]; then exit; fi
    xbuild /nologo /v:m /p:Configuration=Release "/p:Platform=Any CPU"
    if [ $? -ne 0 ]; then exit; fi
popd

objexport="tools/objexport/bin/Release/objexport.exe"
if [ ! -f $objexport ]; then
    echo -e "\033[0;31m$objexport not found"
    exit
fi

mono $objexport $objdata $outputdir