From ddfb138dd013da9c048fdc3e6cbcb14990e57b76 Mon Sep 17 00:00:00 2001 From: Vishwak Srinivasan Date: Sun, 17 Jan 2021 11:20:16 -0500 Subject: [PATCH] Fix ASCII issue with compilation (#96) --- content/main_compiler.sh | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/content/main_compiler.sh b/content/main_compiler.sh index 9f3743c..5cea36b 100755 --- a/content/main_compiler.sh +++ b/content/main_compiler.sh @@ -21,6 +21,10 @@ SUB_FILE=$2 . ${PROB_FDR}/${PROB_CODE}/compilation_script.sh +if ! file --mime -b ${SUBPATH} | grep -i -q "ascii" ; then # checking for ASCII source files + return $FAILURE +fi + # Now perform string-matching to get the extension # and the corresponding "executable" SUBPATH=${SUB_FDR}/${SUB_FILE} @@ -57,5 +61,5 @@ case "$SUBPATH" in ;; esac -# Return the return value of the +# Return the status of compilation return $?