diff --git a/2ano/1semestre/aed/setup.sh b/2ano/1semestre/aed/setup.sh index c657912..a35e61b 100755 --- a/2ano/1semestre/aed/setup.sh +++ b/2ano/1semestre/aed/setup.sh @@ -1,5 +1,8 @@ #!/bin/bash +parent_path=$( cd "$(dirname "${BASH_SOURCE[0]}")" || exit ; pwd -P ) +cd "$parent_path" || exit + if [ $# -ne 1 ]; then echo "Usage: $0 " exit 1 @@ -22,4 +25,9 @@ fi gcc -Wall -Wextra -Werror -g -o "out/$out_dirname/${out_basename%.*}" "$1" -lm +if [ $? -ne 0 ]; then + echo "Compilation failed" + exit 1 +fi + out/"$out_dirname"/"${out_basename%.*}"