From 1db5aedfc0966197333304f39a3ee87b753d85b1 Mon Sep 17 00:00:00 2001 From: Philip Zembrod Date: Thu, 6 Jan 2022 16:30:46 +0100 Subject: [PATCH] Auto-end run-in-dosbox.sh only if 2nd arg include_basename is given --- 8086/msdos/emulator/run-in-dosbox.sh | 23 +++++++++++------------ 1 file changed, 11 insertions(+), 12 deletions(-) diff --git a/8086/msdos/emulator/run-in-dosbox.sh b/8086/msdos/emulator/run-in-dosbox.sh index efd0ff5..bbc00a3 100755 --- a/8086/msdos/emulator/run-in-dosbox.sh +++ b/8086/msdos/emulator/run-in-dosbox.sh @@ -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