sourcemod/plugins/compile.sh
WildCard65 8e4836f83a Added spacing to compile.sh
And made it exit out on compile error.
2014-06-14 08:32:24 -04:00

29 lines
527 B
Bash
Executable File

#!/bin/bash
cd "$(dirname "$0")"
test -e compiled || mkdir compiled
if [[ $# -ne 0 ]]; then
for i in "$@";
do
smxfile="`echo $i | sed -e 's/\.sp$/\.smx/'`";
echo -e "Compiling $i...";
./spcomp $i -ocompiled/$smxfile
RETVAL=$?
if [ $RETVAL -ne 0 ]; then
exit 1;
fi
done
else
for sourcefile in *.sp
do
smxfile="`echo $sourcefile | sed -e 's/\.sp$/\.smx/'`"
echo -e "Compiling $sourcefile ..."
./spcomp $sourcefile -ocompiled/$smxfile
RETVAL=$?
if [ $RETVAL -ne 0 ]; then
exit 1;
fi
done
fi