From 04e966fef5b21061b6056ea000c9c6994cf33723 Mon Sep 17 00:00:00 2001 From: EnumDev Date: Sun, 19 Oct 2025 16:26:57 +0300 Subject: [PATCH] Hide URL and license from readable info if empty --- src/bpmlib/databases.go | 8 ++++++-- src/bpmlib/packages.go | 8 ++++++-- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/src/bpmlib/databases.go b/src/bpmlib/databases.go index 4c53db7..3d78f6e 100644 --- a/src/bpmlib/databases.go +++ b/src/bpmlib/databases.go @@ -299,8 +299,12 @@ func (entry *BPMDatabaseEntry) CreateReadableInfo(rootDir string) string { ret = append(ret, "Database: "+entry.Database.Name) ret = append(ret, "Description: "+entry.Info.Description) ret = append(ret, "Version: "+entry.Info.GetFullVersion()) - ret = append(ret, "URL: "+entry.Info.Url) - ret = append(ret, "License: "+entry.Info.License) + if entry.Info.Url != "" { + ret = append(ret, "URL: "+entry.Info.Url) + } + if entry.Info.License != "" { + ret = append(ret, "License: "+entry.Info.License) + } ret = append(ret, "Architecture: "+entry.Info.Arch) if entry.Info.Type == "source" && entry.Info.OutputArch != "" && entry.Info.OutputArch != GetArch() { ret = append(ret, "Output architecture: "+entry.Info.OutputArch) diff --git a/src/bpmlib/packages.go b/src/bpmlib/packages.go index f1e48de..73e2ba5 100644 --- a/src/bpmlib/packages.go +++ b/src/bpmlib/packages.go @@ -523,8 +523,12 @@ func (pkgInfo *PackageInfo) CreateReadableInfo(rootDir string) string { ret = append(ret, "Name: "+pkgInfo.Name) ret = append(ret, "Description: "+pkgInfo.Description) ret = append(ret, "Version: "+pkgInfo.GetFullVersion()) - ret = append(ret, "URL: "+pkgInfo.Url) - ret = append(ret, "License: "+pkgInfo.License) + if pkgInfo.Url != "" { + ret = append(ret, "URL: "+pkgInfo.Url) + } + if pkgInfo.License != "" { + ret = append(ret, "License: "+pkgInfo.License) + } ret = append(ret, "Architecture: "+pkgInfo.Arch) if pkgInfo.Type == "source" && pkgInfo.OutputArch != "" && pkgInfo.OutputArch != GetArch() { ret = append(ret, "Output architecture: "+pkgInfo.Arch)