tibasicc 569 B

12345678910111213141516
  1. #!/bin/bash
  2. # print error message and exit script when no arguments given
  3. ((!$#)) && echo "Error: No filename specified!" && exit 1
  4. # make a temporary directory to run the preprocessor before compiling
  5. mkdir .preprocessor-temp-dir
  6. cp "$1" ".preprocessor-temp-dir/$1"
  7. sed -i "s/\s*#.*//g; s/^\s*//g; /^$/ d" ".preprocessor-temp-dir/$1"
  8. # run the actual compiler
  9. wine ~/.winetesting/tibasic-1.4.4/tibasic.exe ".preprocessor-temp-dir/$1" &>/tmp/tibasic-preprocessor.log
  10. mv .preprocessor-temp-dir/*.8xp .
  11. # remove the temporary directory
  12. rm -r .preprocessor-temp-dir/