mirror of
https://bitbucket.org/seefoe/dockerized-swg.git
synced 2026-01-16 23:04:17 -05:00
35 lines
1.0 KiB
Bash
Executable File
35 lines
1.0 KiB
Bash
Executable File
#!/bin/bash
|
|
|
|
server=$(find ./dsrc/sku.0/sys.server/compiled/game/datatables -name '*.tab')
|
|
inc=$(find ./dsrc/sku.0/sys.shared/compiled/game/datatables/include -name '*.tab')
|
|
shared=$(find ./dsrc/sku.0/sys.shared/compiled/game/datatables -name '*.tab')
|
|
|
|
filenames=("${server[@]}" "${inc[@]}" "${shared[@]}")
|
|
|
|
spinstr='|/-\'
|
|
i=0
|
|
current=0
|
|
total=$(ls ${filenames[@]} | wc -l)
|
|
|
|
for filename in ${filenames[@]}; do
|
|
ofilename=${filename/dsrc/data}
|
|
ofilename=${ofilename/.tab/.iff}
|
|
mkdir -p $(dirname $ofilename)
|
|
|
|
if [[ -e $ofilename && $filename -nt $ofilename ]] || [ ! -e $ofilename ]; then
|
|
result=$(./bin/DataTableTool -i "$filename" -o "$ofilename" -- -s SharedFile searchPath10=data/sku.0/sys.shared/compiled/game searchPath10=data/sku.0/sys.server/compiled/game 2>&1)
|
|
|
|
if [[ ! $result =~ .*SUCCESS.* ]]; then
|
|
printf "\r$filename\n"
|
|
printf "$result\n\n"
|
|
fi
|
|
fi
|
|
|
|
current=$((current+1))
|
|
i=$(( (i+1) %4 ))
|
|
perc=$(bc -l <<< "scale=0; $current*100/$total")
|
|
printf "\rGenerating Datatables: [${spinstr:$i:1}] $perc%%"
|
|
done
|
|
|
|
echo ""
|