Getting Output From Rebol2 on Windows GitHub Actions

For reasons of comparative testing or otherwise, it can be useful to run Rebol2.exe on something like GitHub Actions. But it's tricky, since there's not support for interactivity from "plain" consoles...just the GUI.

  • If you use the --nowindow option you can avoid a GUI Window, and then redirect Rebol2's output to a file.

    • But then you don't get the output until it finishes--if it finishes.
  • So the way to get a stream of output into the GitHub Actions log is to use piping.

But... What Do You Pipe Into?

On UNIX you can pipe anything into cat, and it will "con-cat-enate" whatever it gets back to the terminal

$ echo "CAT just repeats" | cat
CAT just repeats

Windows doesn't really have an analogue to that, because its seemingly-similar TYPE shell command can't be piped into.

The trick I came up with offhand was a batch file that pipes into FIND and excludes any line that contains the word "voodoo":

# Note: Writing a line from cmd.exe that contains quotes like this is
# seemingly impossible...escaping with ^" or "" or \" just don't work.
# Bash may be ugly, but at least it doesn't have so many glaring holes.
#
- name: Download And Wrap Rebol2 Interpreter
  run: |
    curl -o rebol2-core.exe -L http://www.rebol.com/downloads/v278/rebol-core-278-3-1.exe
    echo "rebol2-core.exe --nowindow %* | find /V \"voodoo\"" > rebol2.bat

So that gives you a Rebol2 command that will behave as you would probably expect something on GitHub Actions to act.

# See notes above about why Rebol2 is a batch file that does piping.
#
- name: Demonstrate Rebol2 Working
  shell: cmd
  run: |
    rebol2 --do "print {Hello from Rebol2 Piping Batch Wrapper}"

Of course these days we can pipe into Ren-C and it can be made to work. But this is a bit lighter weight.

2 Likes