Dammit Codecontrol not working, missed this one.

This commit is contained in:
swg
2016-02-05 20:20:21 +01:00
parent 07adc9685b
commit b393ac94f3

View File

@@ -0,0 +1,40 @@
#!/bin/bash
DIR="$( dirname "${BASH_SOURCE[0]}" )"
spinstr='|/-\'
i=0
filenames=$(find $1 -type f \( -name '*.script' -o -name '*.scriptlib' \) -not -path "*/.deps/*")
current=0
total=$(ls ${filenames[@]} | wc -l)
jobs=$(ps aux | grep "script_prep2.py" | wc -l)
compile () {
OFILENAME=${filename//.scriptlib/.java}
OFILENAME=${OFILENAME//.script/.java}
ok=1
if [[ -e $OFILENAME && $filename -nt $OFILENAME ]] || [ ! -e $OFILENAME ]; then
${DIR}/script_prep2.py -i $filename -o $OFILENAME || ok=0
if [ ! $ok -eq 1 ]; then
printf "$filename $OFILENAME\n\n"
fi
fi
}
for filename in $filenames; do
current=$((current+1))
i=$(( (i+1) %4 ))
perc=$(bc -l <<< "scale=0; $current*100/$total")
printf "\rConverting .scripts [${spinstr:$i:1}] $perc%%"
while [ $jobs -ge 50 ]
do
sleep 5
done
compile $filename & done
wait
echo ""