// https://github.com/dotnet/coreclr/blob/master/src/coreclr/hosts/coreconsole/coreconsole.cpp private static int Main(string[] args) { EntryConfiguration configuration = new EntryConfiguration(); var localpath = XAssembliesBase.GetEntryAssemblyLocalPath(); if (localpath == null) { XLogBase.LogCritical("Failed to get the path to the current executable."); XConsole.Api.WaitForAcknowledgement(5000); // https://stackoverflow.com/questions/57615/how-to-add-a-timeout-to-console-readline return(-1); } char[] extension = null; //XIO.GetExtensionAsArray(localpath, Case.Lower); // Case.Default, Case.Unknown, Case.Upper extension[1] = 'd'; extension[2] = 'l'; extension[3] = 'l'; bool verbose = false; bool waitForDebugger; bool helpRequested = false; if (helpRequested) { ShowHelp(); return(-1); } else { if (verbose) { XLog.SetLogLevel(LogLevels.Trace); } ProgramResult result = TryRun(configuration); if (result.Successful) { Console.WriteLine("Execution succeeded"); return(0); } else { Console.WriteLine("Execution failed."); return(-1); } } }
public DirectoryPath GetEntryAssemblyLocalPath() { return(XAssembliesBase.GetEntryAssemblyLocalPath()); }
/// <summary> /// Gets all the files that are in a directory that are an assembly based upon their extension /// </summary> /// <param name="directory"></param> /// <returns></returns> public List <AbsoluteFilePath> GetAssemblyFiles(DirectoryPath directory) { return(XAssembliesBase.GetAssemblyFiles(directory)); }
/// <summary> /// Gets whether the file is an executable based upon its file extension alone. /// </summary> /// <returns>Returns true if the file is an executable file, else it returns false</returns> public bool IsExe(AbsoluteFilePath filePath) { return(XAssembliesBase.IsExe(filePath)); }