PublishModModel BuildPublishModel(string registerInfo) { var yml = WorkingPath.GetChildDirectoryWithName(".rsync\\.pack") .GetChildFileWithName(".repository.yml"); var cppInfo = GetCppInfo(); return(new PublishModModel { PackageName = MetaData.Name, Revision = yml.Exists ? (int)SyncEvilGlobal.Yaml.NewFromYamlFile <RepoVersion>(yml).Version : 0, Version = MetaData.GetVersionInfo(), Size = MetaData.SizePacked, SizeWd = MetaData.Size, Readme = GetReadme(), Changelog = GetChangelog(), License = GetLicense(), CppName = cppInfo.Item1, Description = cppInfo.Item2.TruncateNullSafe(500), Author = cppInfo.Item3, RegisterInfo = registerInfo }); }
IEnumerable <IAbsoluteDirectoryPath> GetEmptyDirectories(IEnumerable <string> remove) => remove.Select(Path.GetDirectoryName) .Distinct() .Select(x => WorkingPath.GetChildDirectoryWithName(x)) .Where(x => Tools.FileUtil.IsDirectoryEmpty(x));