Skip to content

Instantly share code, notes, and snippets.

@dexterous
Last active May 13, 2021 04:04
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dexterous/3627b1b844e24038ac4cad197c64e0f4 to your computer and use it in GitHub Desktop.
Save dexterous/3627b1b844e24038ac4cad197c64e0f4 to your computer and use it in GitHub Desktop.
#!/bin/bash -e
if [[ -n "$DEBUG" ]]; then
set -x
PS4='+ [ $(date +%T) ] '
fi
if [[ -f ./main.exe && ./main.exe -ot ./main.cs ]]; then
echo -n "Compiled binary outdated; removing... "
rm main.exe
echo "done."
fi
NAMESPACES="$(sed -nre '/^[^#]/ { s,^.+$,-r:&,; p }' <namespaces)"
if [[ ! -f ./main.exe ]]; then
echo -n "Compiling... "
#shellcheck disable=2086
mcs $NAMESPACES -o:main.exe main.cs
#shellcheck disable=2181
if [[ $? -eq 0 ]]; then
echo "done."
fi
fi
if [[ -f ./main.exe ]]; then
echo "Running binary; output to follow..."
mono main.exe
fi
#System.Net
System.Net.Http
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment