Skip to content

Commit 0a15bca

Browse files
committed
fix(provisionersdk): add trailing path separator to directory entries
1 parent 61f1dfd commit 0a15bca

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

provisionersdk/archive.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,11 @@ func Tar(w io.Writer, logger slog.Logger, directory string, limit int64) error {
107107
}
108108
// Use unix paths in the tar archive.
109109
header.Name = filepath.ToSlash(rel)
110+
// tar.FileInfoHeader() will do this, but filepath.Rel() calls filepath.Clean()
111+
// which strips trailing path separators for directories.
112+
if fileInfo.IsDir() {
113+
header.Name += "/"
114+
}
110115
if err := tarWriter.WriteHeader(header); err != nil {
111116
return err
112117
}

0 commit comments

Comments
 (0)