Created
December 13, 2015 14:25
-
-
Save MrWooJ/705613bbb9e6dbfaf328 to your computer and use it in GitHub Desktop.
Build & Run Simple C# Codes
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/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