Skip to content

Instantly share code, notes, and snippets.

@MrWooJ
Created December 13, 2015 14:25
Show Gist options
  • Select an option

  • Save MrWooJ/705613bbb9e6dbfaf328 to your computer and use it in GitHub Desktop.

Select an option

Save MrWooJ/705613bbb9e6dbfaf328 to your computer and use it in GitHub Desktop.
Build & Run Simple C# Codes
#!/bin/bash
buildFile=$1
runFile="${buildFile%.*}.exe"
RED='\033[0;31m'
GRE='\033[0;32m'
BBLU='\033[1;34m'
NOCOLOR='\033[0m'
if [[ -n "$buildFile" ]]; then
if [[ -e "$runFile" ]]; then
echo -e "${BBLU}[WJRUNNABLE]${GRE} START REMOVING OLD FILR${NOCOLOR}"
rm $runFile
echo -e "${BBLU}[WJRUNNABLE]${GRE} END REMOVING OLD FILR${NOCOLOR}"
fi
echo -e "${BBLU}[WJRUNNABLE]${GRE} START BUILDING${NOCOLOR}"
mcs $buildFile
echo -e "${BBLU}[WJRUNNABLE]${GRE} END BUILDING${NOCOLOR}"
if [[ -e "$runFile" ]]; then
echo -e "${BBLU}[WJRUNNABLE]${GRE} START RUNNING${NOCOLOR}"
echo ""
mono $runFile
echo ""
else
echo -e "${BBLU}[WJRUNNABLE]${RED} END BUILDING - ERROR OCCURED${NOCOLOR}"
fi
else
echo -e "${BBLU}[WJRUNNABLE]${RED} INPUT ARGUMENT ERROR${NOCOLOR}"
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment