2022-01-06 13:55:53 +00:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
set -e
|
|
|
|
|
|
|
|
emulatordir="$(realpath --relative-to="$PWD" "$(dirname "${BASH_SOURCE[0]}")")"
|
|
|
|
basedir="$(realpath --relative-to="$PWD" "${emulatordir}/..")"
|
|
|
|
|
|
|
|
forth="$1"
|
2022-01-11 22:40:24 +00:00
|
|
|
include_filename="$2"
|
|
|
|
include_basename="${include_filename%.*}"
|
2022-01-06 13:55:53 +00:00
|
|
|
forthcmd=""
|
|
|
|
exit=""
|
|
|
|
bye=""
|
2022-01-06 15:30:46 +00:00
|
|
|
if [ -n "${include_basename}" ]; then
|
2022-01-11 22:40:24 +00:00
|
|
|
forthcmd="include ${include_filename}"
|
2022-01-06 15:30:46 +00:00
|
|
|
logname="${include_basename}.log"
|
|
|
|
doslogname="$(echo ${logname}|tr '[:lower:]' '[:upper:]')"
|
|
|
|
rm -f "${logname}" "${doslogname}"
|
|
|
|
if [ -z "${KEEPEMU}" ]; then
|
|
|
|
exit="-c exit"
|
|
|
|
bye="bye"
|
|
|
|
fi
|
2022-01-06 13:55:53 +00:00
|
|
|
fi
|
|
|
|
|
|
|
|
auto_c=""
|
|
|
|
autocmd=""
|
|
|
|
if [ -n "${forth}" ]; then
|
|
|
|
auto_c="-c"
|
2022-01-10 21:33:25 +00:00
|
|
|
autocmd="${forth} path f:\\;f:\\src;f:\\tests ${forthcmd} ${bye}"
|
2022-01-06 13:55:53 +00:00
|
|
|
fi
|
|
|
|
|
|
|
|
dosbox -c "mount f ${basedir}" -c "f:" "${auto_c}" "${autocmd}" $exit
|
|
|
|
|
2022-01-06 15:30:46 +00:00
|
|
|
if [ -n "${include_basename}" ]; then
|
2022-01-06 13:55:53 +00:00
|
|
|
dos2unix -n "${doslogname}" "${logname}"
|
|
|
|
fi
|