private void InitializeRoutes() { var routesContent = new EmbeddedFileProvider().GetContentsForFile("Commands.InitContent.routes.json"); const string fileName = "routes.json"; var routesFilePath = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, fileName); if (_fileProvider.Exists(routesFilePath)) { _logger.Info($"{fileName} file already exists."); } else { File.WriteAllText(routesFilePath, routesContent); _logger.Info($"{fileName} file created."); } }
private void InitializeSampleTemplate() { var templateContent = new EmbeddedFileProvider().GetContentsForFile("Commands.InitContent.Sample.template"); var folder = "Templates"; var fileName = "Sample.template"; var folderPath = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, folder); var templatePath = Path.Combine(folderPath, fileName); if (!_directoryProvider.Exists(folderPath)) { _directoryProvider.CreateDirectory(folderPath); } if (_fileProvider.Exists(templatePath)) { _logger.Info($"{folder}/{fileName} file already exists."); } else { File.WriteAllText(templatePath, templateContent); _logger.Info($"{fileName} created under the {folder} folder."); } }