Error handlng
This commit is contained in:
parent
6943a42990
commit
b7ae8b79c9
11
.bashrc
11
.bashrc
|
@ -149,11 +149,16 @@ timoulinette () {
|
|||
git_full="${git_base}/${subject}/${ex}/${test_file_name}"
|
||||
|
||||
# Name of the C testfile
|
||||
download_file_name="./timo_moulinette_${subject}_${ex}_${test_file_name}"
|
||||
download_file_name="./timoulinette${subject}_${ex}_${test_file_name}"
|
||||
|
||||
# Download tesfile
|
||||
curl -sL "${git_full}" -o "${download_file_name}"
|
||||
|
||||
if [ ! "${?}" = "1" ] ; then
|
||||
printf '%s\n' "There's now testfile for this task, sorry!"
|
||||
return
|
||||
fi
|
||||
|
||||
# Preprocess source file (remove comments)
|
||||
${CC} -dD -E -o "${file_name}.nocomments" -- "${file_name}"
|
||||
|
||||
|
@ -181,7 +186,7 @@ timoulinette () {
|
|||
guard_name="$(safe_guard_name "${macro}")"
|
||||
|
||||
# Endif include guard
|
||||
printf '%s\n' "#endif" | cat -- - "${download_file_name}" > ".tmpaddfirstlinefile.c"
|
||||
printf '%s\n\n' "#endif" | cat -- - "${download_file_name}" > ".tmpaddfirstlinefile.c"
|
||||
mv -- ".tmpaddfirstlinefile.c" "${download_file_name}"
|
||||
|
||||
# The macro itself
|
||||
|
@ -199,7 +204,7 @@ timoulinette () {
|
|||
IFS="$(printf ' \n\t')"
|
||||
|
||||
# Compile
|
||||
out_binary="timo_moulinette_${subject}_${ex}_$(basename -- "${test_file_name}" .c).out"
|
||||
out_binary="timoulinette${subject}_${ex}_$(basename -- "${test_file_name}" .c).out"
|
||||
${CC} -Wall -Wextra -Werror -o "${out_binary}" -xc -- *.c
|
||||
err_code="${?}"
|
||||
|
||||
|
|
Loading…
Reference in New Issue