public void PrintsConfig() { const string simpleConfig = @"#comment key1=value1 key2=value2 "; // const string expectedOutputPattern = //@"Main config file\: .+\\config.cfg //Override config file\: N/A //Values\: //KEY1\=value1 //KEY2\=value2 //End"; using (DirectoryHandle tempDir1 = TempDirectoriesFactory.CreateEmpty()) { var localCfgPath = Path.Combine(tempDir1.AbsolutePath, "config.cfg"); File.WriteAllText(localCfgPath, simpleConfig); FileSimpleConfig localConfig = new FileSimpleConfig(localCfgPath); var result = localConfig.ToString(); //verify manually if needed } }
static void Main(string[] args) { PrintArgs(args); var assemblyDir = typeof (Program).Assembly.GetAssemblyLocationFullPath();// Directory.GetCurrentDirectory(); var tempDir = Path.Combine(assemblyDir, "temp"); ClearDir(tempDir); ValidateArgs(args); var command = args[0]; var configPath = Path.Combine(assemblyDir, command); if (!File.Exists(configPath)) { throw new ArgumentException("config file does not exist, path: " + configPath); } IOutput output = new ConsoleOutput(); IConfig config = new FileSimpleConfig(configPath); output.Write(config.ToString()); if (command.In("publish-package-wa3-stable.cfg", "publish-package-walite-stable.cfg")) { var action = new PublishPackage(config, tempDir, output); action.Execute(); } else { throw new ArgumentException("*.cfg file name does not match any supported config"); } }
static void Main(string[] args) { PrintArgs(args); var assemblyDir = typeof(Program).Assembly.GetAssemblyLocationFullPath(); // Directory.GetCurrentDirectory(); var tempDir = Path.Combine(assemblyDir, "temp"); ClearDir(tempDir); ValidateArgs(args); var command = args[0]; var configPath = Path.Combine(assemblyDir, command); if (!File.Exists(configPath)) { throw new ArgumentException("config file does not exist, path: " + configPath); } IOutput output = new ConsoleOutput(); IConfig config = new FileSimpleConfig(configPath); output.Write(config.ToString()); var action = new PublishPackage(config, tempDir, output); action.Execute(); }