Last active
September 23, 2015 04:17
-
-
Save SjB/e28f772316ace0612ef7 to your computer and use it in GitHub Desktop.
Run a CSharp executable (uses mono on Unix)
This file contains 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
Func<FilePath, IEnumerable<string>, int> CsProc = delegate(FilePath proc, IEnumerable<string> arguments) { | |
var processArgs = new ProcessArgumentBuilder(); | |
FilePath process; | |
Information(proc.ToString()); | |
if (IsRunningOnWindows()) { | |
process = proc; | |
} else { | |
processArgs.Append(proc.ToString()); | |
process = File("mono"); | |
} | |
foreach (var arg in arguments) | |
processArgs.Append(arg); | |
return StartProcess(process, new ProcessSettings { Arguments = processArgs }); | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment