Skip to content

Instantly share code, notes, and snippets.

@baronfel
Created April 8, 2018 19:42
Show Gist options
  • Save baronfel/adf6152842c2100d33637d83c15a90f9 to your computer and use it in GitHub Desktop.
Save baronfel/adf6152842c2100d33637d83c15a90f9 to your computer and use it in GitHub Desktop.
modified fsharpi that handles piped inputs nicer (Thanks John Wostenberg!)
#!/bin/sh
EXEC="exec "
FSHARPI_OPTIONS=""
if test x"$1" = x--debug; then
DEBUG=--debug
shift
fi
if test x"$1" = x--gdb; then
shift
EXEC="gdb --eval-command=run --args "
fi
if test x"$1" = x--valgrind; then
shift
EXEC="valgrind $VALGRIND_OPTIONS"
fi
if ! [ -t 0 ]; then
FSHARPI_OPTIONS="--readline-"
fi
# Beware this line must match the regular expression " (\/.*)\/fsi\.exe" when fsi.exe is fsi.exe.
# That's because the FSharp MonoDevelop addin looks inside the text of this script to determine the installation
# location of the default FSharp install in order to find the FSharp compiler binaries (see
# fsharpbinding/MonoDevelop.FSharpBinding/Services/CompilerLocationUtils.fs). That's a pretty unfortunate
# way of finding those binaries. And really should be changed.
$EXEC /Library/Frameworks/Mono.framework/Versions/5.10.0/bin/mono $DEBUG $MONO_OPTIONS /Library/Frameworks/Mono.framework/Versions/5.10.0/lib/mono/fsharp/fsi.exe $FSHARPI_OPTIONS --exename:"$(basename "$0")" "$@"
@baronfel
Copy link
Author

baronfel commented Apr 8, 2018

Note that you may need to update your path to mono

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment