From 8e4836f83a4adc94d482393c00b935f2860d275a Mon Sep 17 00:00:00 2001 From: WildCard65 Date: Sat, 14 Jun 2014 08:25:19 -0400 Subject: [PATCH] Added spacing to compile.sh And made it exit out on compile error. --- plugins/compile.sh | 36 +++++++++++++++++++++--------------- 1 file changed, 21 insertions(+), 15 deletions(-) diff --git a/plugins/compile.sh b/plugins/compile.sh index 35c2c0df..cf1740a9 100755 --- a/plugins/compile.sh +++ b/plugins/compile.sh @@ -3,20 +3,26 @@ 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 -n "Compiling $i..."; - ./spcomp $i -ocompiled/$smxfile - done +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 -n "Compiling $sourcefile ..." - ./spcomp $sourcefile -ocompiled/$smxfile -done + 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