public static void List() { var scripts = new List <Script>(ScriptDomain.CurrentDomain.RunningScripts); scripts.Remove(ScriptDomain.CurrentDomain.Console); if (scripts.Count == 0) { Console.Info("There are no scripts loaded"); return; } String basedirectory = ScriptDomain.CurrentDomain.AppDomain.BaseDirectory; Console.Info("---"); foreach (var script in scripts) { String filename = script.Filename; if (filename.StartsWith(basedirectory, StringComparison.OrdinalIgnoreCase)) { filename = filename.Substring(basedirectory.Length + 1); } Console.Info(" " + filename + ": " + script.Name + (script._running ? " ~g~[running]" : " ~r~[aborted]")); } Console.Info("---"); }
public static string GetPath(string path, bool create = false) { string resultPath = Path.Combine(BasePath, path); Console.Info(resultPath); if (create) { Directory.CreateDirectory(Path.GetDirectoryName(resultPath)); } return(resultPath); }