Skip to content

Commit 01079f1

Browse files
committed
add check if file exhists
1 parent b12aefc commit 01079f1

1 file changed

Lines changed: 9 additions & 5 deletions

File tree

EESSI-install-software.sh

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -413,11 +413,15 @@ else
413413
# copy EasyBuild log file if EasyBuild exited with an error
414414
if [ ${ec} -ne 0 ]; then
415415
eb_last_log=$(eb --last-log | grep ^/.*\.log)
416-
# copy to current working directory
417-
cp -a ${eb_last_log} .
418-
echo "Last EasyBuild log file copied from ${eb_last_log} to ${PWD}"
419-
# copy to build logs dir (with context added)
420-
copy_build_log "${eb_last_log}" "${build_logs_dir}"
416+
# copy to current working directory if file exhists
417+
if [ -e ${eb_last_log} ]; then
418+
cp -a ${eb_last_log} .
419+
echo "Last EasyBuild log file copied from ${eb_last_log} to ${PWD}"
420+
# copy to build logs dir (with context added)
421+
copy_build_log "${eb_last_log}" "${build_logs_dir}"
422+
else
423+
fatal_error "Could not copy EasyBuild log file because ${eb_last_log} does not exhist"
424+
fi
421425
fi
422426

423427
$TOPDIR/check_missing_installations.sh ${easystack_file} ${pr_diff}

0 commit comments

Comments
 (0)