static void Run(Options opts) { ExtensionInfo.DummyRef(); var extPath = "./"; var configPath = "./"; var logger = new ConsoleLogger() { IncludePreamble = false }; configPath = Path.GetFullPath(opts.ConfigPath); extPath = Path.GetFullPath(opts.ExtPath); var extDir = new DirectoryInfo(extPath); if (!extDir.Exists) { logger.Info("No such directory: " + extPath); return; } var pc = new ClientContext(configPath); logger.Info(""); logger.Info(" Extension: " + extPath); logger.Info(" Config: " + configPath); var ctx = new ProgramContext(pc) { SourceDirectory = extDir, IsBase = opts.ExtensionKey == "prime:base", Logger = logger }; if (opts.ExtensionKey != null) { ctx.ExtId = opts.ExtensionKey.GetObjectIdHashCode(); } if (opts.ExtensionId != null) { ctx.ExtId = opts.ExtensionId; } ctx.ExtractNuget = opts.Nuget; Process.Go(ctx); logger.Info(""); }
static void Main(string[] args) { ExtensionInfo.DummyRef(); var extPath = "./"; var configPath = "./"; var isPrime = false; if (args != null && args.Length > 0) { extPath = args[0]; } var logger = new ConsoleLogger() { IncludePreamble = false }; if (Debugger.IsAttached) { configPath = "..\\..\\..\\..\\..\\..\\instance\\prime-client.config"; extPath = "..\\..\\..\\..\\..\\..\\Ext\\Prime.IPFS\\Prime.IPFS.Win64\\bin\\Debug"; } else { if (args == null || args.Length < 2) { logger.Info("Usage: [configPath] [extPath] [-core]"); return; } configPath = args[0]; extPath = args[1]; isPrime = args.Length > 2 && args[3] == "-core"; } configPath = Path.GetFullPath(configPath); extPath = Path.GetFullPath(extPath); var extDir = new DirectoryInfo(extPath); if (!extDir.Exists) { logger.Info("No such directory: " + extPath); return; } var pc = new ClientContext(configPath); logger.Info("config: " + configPath); logger.Info("extension: " + extPath); var ctx = new ProgramContext(pc) { SourceDirectory = extDir, IsPrime = isPrime, Logger = logger }; Process.Go(ctx); logger.Info(""); }