public void Exec(SubCommandRunningContext context) { // TODO: remove BaseDirectory from Config, it may cause potential issue when abused var baseDirectory = EnvironmentContext.BaseDirectory; var intermediateOutputFolder = Path.Combine(baseDirectory, "obj"); var outputFolder = Path.GetFullPath(Path.Combine(string.IsNullOrEmpty(Config.OutputFolder) ? baseDirectory : Config.OutputFolder, Config.Destination ?? string.Empty)); BuildDocument(baseDirectory, outputFolder); _templateManager.ProcessTheme(outputFolder, true); // TODO: SEARCH DATA if (Config?.Serve ?? false) { ServeCommand.Serve(outputFolder, Config.Port); } }
public void Exec(SubCommandRunningContext context) { var config = Config; var baseDirectory = config.BaseDirectory ?? Environment.CurrentDirectory; var intermediateOutputFolder = Path.Combine(baseDirectory, "obj"); var outputFolder = Path.Combine(config.OutputFolder ?? config.BaseDirectory ?? string.Empty, config.Destination ?? string.Empty); BuildDocument(baseDirectory, outputFolder); _templateManager.ProcessTheme(outputFolder, true); // TODO: SEARCH DATA if (config?.Serve ?? false) { ServeCommand.Serve(outputFolder, config.Port); } }
public void Exec(SubCommandRunningContext context) { EnvironmentContext.SetGitFeaturesDisabled(Config.DisableGitFeatures); EnvironmentContext.SetBaseDirectory(Path.GetFullPath(string.IsNullOrEmpty(Config.BaseDirectory) ? Directory.GetCurrentDirectory() : Config.BaseDirectory)); // TODO: remove BaseDirectory from Config, it may cause potential issue when abused var baseDirectory = EnvironmentContext.BaseDirectory; Config.IntermediateFolder = Config.IntermediateFolder ?? Path.Combine(baseDirectory, "obj", ".cache", "build"); var outputFolder = Path.GetFullPath(Path.Combine(string.IsNullOrEmpty(Config.OutputFolder) ? baseDirectory : Config.OutputFolder, Config.Destination ?? string.Empty)); BuildDocument(baseDirectory, outputFolder); _templateManager.ProcessTheme(outputFolder, true); // TODO: SEARCH DATA if (Config?.Serve ?? false) { ServeCommand.Serve(outputFolder, Config.Host, Config.Port); } EnvironmentContext.Clean(); }