#!/usr/bin/env bash # Launch the built DOS example in DOSBox. Defaults to PATTERN; pass # "hello" to run HELLO instead. # # scripts/run-dos.sh # runs PATTERN # scripts/run-dos.sh hello # runs HELLO set -euo pipefail prog=${1:-pattern} repo=$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd) bin_dir=$repo/build/dos/bin case $prog in hello) file=HELLO.EXE ;; pattern) file=PATTERN.EXE ;; *) echo "usage: $0 [hello|pattern]" >&2; exit 2 ;; esac if [[ ! -f "$bin_dir/$file" ]]; then echo "$bin_dir/$file not built. Run 'make dos' first." >&2 exit 1 fi exec dosbox -c "C:" -c "$file" -c "pause" --exit "$bin_dir"