Remove unpack suffixes when generating an index bundle

This commit is contained in:
Daniel 2024-10-16 13:51:38 +02:00
parent eb74b6cc1d
commit d6669ff8f5
3 changed files with 16 additions and 4 deletions
Earthfile
cmds/updatemgr
service/updates

View file

@ -177,7 +177,7 @@ go-build:
ARG GOOS=linux
ARG GOARCH=amd64
ARG GOARM
ARG CMDS=portmaster-start portmaster-core
ARG CMDS=portmaster-core
CACHE --sharing shared "$GOCACHE"
CACHE --sharing shared "$GOMODCACHE"

View file

@ -31,15 +31,22 @@ var (
"**/hubs*.json",
"**/*mini*.mmdb.gz",
// Unsupported platforms.
"darwin_amd64/**",
"darwin_arm64/**",
// Deprecated artifacts.
"**/portmaster-start*",
"**/portmaster-app*",
"**/portmaster-notifier*",
"**/portmaster-wintoast*.dll",
"**/portmaster-snoretoast*.exe",
"**/portmaster-kext*.dll",
"**/profilemgr*.zip",
"**/settings*.zip",
"**/monitor*.zip",
"**/base*.zip",
"**/console*.zip",
"**/portmaster-wintoast*.dll",
"**/portmaster-snoretoast*.exe",
"**/portmaster-kext*.dll",
},
UnpackFiles: map[string]string{
"gz": "**/*.gz",

View file

@ -209,6 +209,11 @@ func GenerateBundleFromDir(bundleDir string, settings BundleFileSettings) (*Bund
artifact.Version = version
}
// Remove unpack suffix.
if artifact.Unpack != "" {
artifact.Filename, _ = strings.CutSuffix(artifact.Filename, "."+artifact.Unpack)
}
// Set local file path.
artifact.localFile = fullpath