Create a gist now

Instantly share code, notes, and snippets.

What would you like to do?
runscripthelper entry point method
private static int Main(string[] args)
{
try
{
if (args.Length != 3)
{
throw new Exception("Invalid command line");
}
string text = args[0];
string text2 = args[1];
string text3 = args[2];
if (string.IsNullOrEmpty(text2) || string.IsNullOrEmpty(text2) || string.IsNullOrEmpty(text3))
{
throw new Exception("Invalid args");
}
if (!Program.k_scriptSet.Contains(text))
{
throw new Exception("Unknown script");
}
string text4 = Environment.ExpandEnvironmentVariables(Program.k_utcScriptPath);
if (text2.Length <= text4.Length || !text4.Equals(text2.Substring(0, text4.Length), StringComparison.OrdinalIgnoreCase))
{
throw new Exception("Unknown script path: " + text2);
}
text2 = Program.GetShortPath(text2);
text3 = Program.GetShortPath(text3);
if (text.CompareTo("surfacecheck") == 0)
{
SurfaceCheckProcessor.ProcessSurfaceCheckScript(text2, text3);
}
}
catch (Exception ex)
{
Console.WriteLine("Exception occurred: " + ex.Message);
Console.WriteLine("Inner Exception: " + ex.InnerException);
return -1;
}
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment