From 242ab65604442d5779f71df23de35dfa44cd7d0f Mon Sep 17 00:00:00 2001 From: Vincent Demeester Date: Mon, 18 Mar 2024 13:51:45 +0100 Subject: [PATCH] =?UTF-8?q?Fix=20tarball=20file=20path=20to=20remove=20the?= =?UTF-8?q?=20output=20prefix=E2=80=A6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This would create weirdly invalid tarball (`{output}/tasks/{task-name}` instead of `tasks/{task-name}`) when release with `--output` not being the current directory. Signed-off-by: Vincent Demeester --- internal/cmd/release.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/internal/cmd/release.go b/internal/cmd/release.go index 98f99d0c..4f701e63 100644 --- a/internal/cmd/release.go +++ b/internal/cmd/release.go @@ -200,7 +200,7 @@ func addToArchive(tw *tar.Writer, filename, output string) error { // If we don't do this the directory strucuture would // not be preserved // https://golang.org/src/archive/tar/common.go?#L626 - header.Name = strings.TrimPrefix(filename, filepath.Base(output)+"/") + header.Name = strings.TrimPrefix(filename, filepath.Join(output, "/")+"/") // Write file header to the tar archive err = tw.WriteHeader(header)