diff --git a/EESSI-install-software.sh b/EESSI-install-software.sh index e4834545..2c674ae8 100755 --- a/EESSI-install-software.sh +++ b/EESSI-install-software.sh @@ -412,12 +412,16 @@ else # copy EasyBuild log file if EasyBuild exited with an error if [ ${ec} -ne 0 ]; then - eb_last_log=$(unset EB_VERBOSE; eb --last-log) - # copy to current working directory - cp -a ${eb_last_log} . - echo "Last EasyBuild log file copied from ${eb_last_log} to ${PWD}" - # copy to build logs dir (with context added) - copy_build_log "${eb_last_log}" "${build_logs_dir}" + eb_last_log=$(eb --last-log | grep ^/.*\.log) + # copy to current working directory if file exhists + if [ -f ${eb_last_log} ]; then + cp -a ${eb_last_log} . + echo "Last EasyBuild log file copied from ${eb_last_log} to ${PWD}" + # copy to build logs dir (with context added) + copy_build_log "${eb_last_log}" "${build_logs_dir}" + else + fatal_error "Could not copy EasyBuild log file because ${eb_last_log} does not exist" + fi fi $TOPDIR/check_missing_installations.sh ${easystack_file} ${pr_diff}