Auto-end run-in-dosbox.sh only if 2nd arg include_basename is given

This commit is contained in:
Philip Zembrod 2022-01-06 16:30:46 +01:00
parent 99276c12cb
commit 1db5aedfc0

View File

@ -6,20 +6,19 @@ emulatordir="$(realpath --relative-to="$PWD" "$(dirname "${BASH_SOURCE[0]}")")"
basedir="$(realpath --relative-to="$PWD" "${emulatordir}/..")"
forth="$1"
srcbasename="$2"
include_basename="$2"
forthcmd=""
if [ -n "${srcbasename}" ]; then
forthcmd="include ${srcbasename}.fb"
logname="${srcbasename}.log"
doslogname="$(echo ${logname}|tr '[:lower:]' '[:upper:]')"
rm -f "${logname}" "${doslogname}"
fi
exit=""
bye=""
if [ -z "${KEEPEMU}" ]; then
exit="-c exit"
bye="bye"
if [ -n "${include_basename}" ]; then
forthcmd="include ${include_basename}.fb"
logname="${include_basename}.log"
doslogname="$(echo ${logname}|tr '[:lower:]' '[:upper:]')"
rm -f "${logname}" "${doslogname}"
if [ -z "${KEEPEMU}" ]; then
exit="-c exit"
bye="bye"
fi
fi
auto_c=""
@ -31,6 +30,6 @@ fi
dosbox -c "mount f ${basedir}" -c "f:" "${auto_c}" "${autocmd}" $exit
if [ -n "${srcbasename}" ]; then
if [ -n "${include_basename}" ]; then
dos2unix -n "${doslogname}" "${logname}"
fi