Skip to content

Commit

Permalink
Fix tarball file path to remove the output prefix…
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
vdemeester committed Mar 18, 2024
1 parent acbfef9 commit 242ab65
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion internal/cmd/release.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 242ab65

Please sign in to comment.