-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathdump_engine_assets_functions.sh
52 lines (45 loc) · 1.08 KB
/
dump_engine_assets_functions.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
#!/bin/bash
. $(dirname "$0")/configuration.sh
if [ -f "${path_to_EngineFileExtractor}" ]; then
echo EngineFileExtractor Exists
else
echo EngineFileExtractor doesnt exist
fi
if [ -d "${path_to_UnityInstallations}" ]; then
echo Unity Folder Exists
else
echo Unity Folder doesnt exist
fi
function make_directories() {
mkdir -p "$(dirname "$0")/EngineAssets"
}
function dump_engine_assets() {
if [ $# = 0 ]
then
echo At least one argument required
exit 2
elif [ $# = 1 ]
then
force_dump=false
elif [ $2 = "-f" ] || [ $2 = "--force" ]
then
force_dump=true
else
force_dump=false
fi
if [ -d "${path_to_UnityInstallations}/$1" ]; then
if [ $force_dump = false ] && [ -f "$(dirname "$0")/EngineAssets/$1.json" ]; then
echo Already Dumped $1
else
echo Dumping $1...
rm -f ${path_to_EngineAssetsJson}
"${path_to_EngineFileExtractor}" "`wslpath -w ${path_to_UnityInstallations}`"/$1 --silent
cp ${path_to_EngineAssetsJson} $(dirname "$0")/EngineAssets/$1.json
fi
else
echo Unity $1 missing, skipped
fi
}
# Make Directories
echo Making Directories
make_directories