Skip to content

Commit

Permalink
Remove unpack suffixes when generating an index bundle
Browse files Browse the repository at this point in the history
  • Loading branch information
dhaavi committed Oct 16, 2024
1 parent eb74b6c commit d6669ff
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 4 deletions.
2 changes: 1 addition & 1 deletion Earthfile
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
13 changes: 10 additions & 3 deletions cmds/updatemgr/scan.go
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
5 changes: 5 additions & 0 deletions service/updates/bundlegeneration.go
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down

0 comments on commit d6669ff

Please sign in to comment.