Ejemplo n.º 1
0
        public Task RunAsync(ConfigModel config)
        {
            return(Task.Run(() =>
            {
                _config = config;
                var targetPath = Path.Combine(Directory.GetParent(config.OutputPath).ToString(), Constants.Doc);

                if (_config.PackageConfigs.Count == 1)
                {
                    var sourcePath = Path.Combine(config.PackageConfigs.FirstOrDefault().RepositoryFolder, Constants.Doc);

                    ConsoleLogger.WriteLine(new LogEntry
                    {
                        Phase = StepName,
                        Level = LogLevel.Info,
                        Message = $" Merge TOC not reqruied, copy toc.yml ..."
                    });

                    CopyUtility.CopyFile(sourcePath, targetPath, Constants.Toc);
                }
                else
                {
                    MergeToc(targetPath);

                    ConsoleLogger.WriteLine(new LogEntry
                    {
                        Phase = StepName,
                        Level = LogLevel.Info,
                        Message = $" Merge TOC completed, write toc.yml to {targetPath} ..."
                    });
                }
            }
                            ));
        }
Ejemplo n.º 2
0
        public Task RunAsync(ConfigModel config)
        {
            return(Task.Run(() =>
            {
                var targetPath = Path.Combine(Directory.GetParent(config.OutputPath).ToString(), Constants.Doc);

                if (!Directory.Exists(targetPath))
                {
                    Directory.CreateDirectory(targetPath);
                }

                foreach (var packageConfig in config.PackageConfigs)
                {
                    var sourcePath = Path.Combine(packageConfig.RepositoryFolder, Constants.Doc);

                    ConsoleLogger.WriteLine(new LogEntry
                    {
                        Phase = StepName,
                        Level = LogLevel.Info,
                        Message = $" Copy yaml files from {sourcePath} to {targetPath}."
                    });

                    var exclusions = new List <string> {
                        Constants.Toc
                    };

                    CopyUtility.CopyWithExclusion(sourcePath, targetPath, exclusions);
                }
            }));
        }