From 50983a9bb28abb7e806e92fe5cfa5a3186b7c725 Mon Sep 17 00:00:00 2001 From: kolaente Date: Wed, 18 Feb 2026 17:05:23 +0100 Subject: [PATCH] fix(build): use absolute path for zip output in release The zip command in Release.Zip() sets its working directory to the release subfolder but used a relative output path, causing it to resolve against the wrong directory. This was a latent bug surfaced by e19a61479 which removed the global RootPath variable. Fix by resolving the zip output path to an absolute path using os.Getwd() at the start of the function. --- magefile.go | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/magefile.go b/magefile.go index aba63e39c..2be191f1b 100644 --- a/magefile.go +++ b/magefile.go @@ -903,6 +903,11 @@ func (Release) OsPackage() error { // Zip creates a zip file from all os-package folders in dist/release func (Release) Zip() error { + rootDir, err := os.Getwd() + if err != nil { + return fmt.Errorf("could not get working directory: %w", err) + } + p := "./" + DIST + "/release/" if err := filepath.Walk(p, func(path string, info os.FileInfo, err error) error { if err != nil { @@ -914,7 +919,8 @@ func (Release) Zip() error { fmt.Printf("Zipping %s...\n", info.Name()) - c := exec.Command("zip", "-r", "./"+DIST+"/zip/"+info.Name()+".zip", ".", "-i", "*") + zipFile := filepath.Join(rootDir, DIST, "zip", info.Name()+".zip") + c := exec.Command("zip", "-r", zipFile, ".", "-i", "*") c.Dir = path out, err := c.Output() fmt.Print(string(out))