Make tar creation more crossplatform by adding files always with forward slash path separators

This commit is contained in:
eleksir
2026-03-27 09:14:04 +03:00
parent fe3ab9c10e
commit 607922be19

View File

@@ -122,7 +122,7 @@ func CreateTarGzStream(ctx context.Context, filepaths []string) io.ReadCloser {
}
header.Format = tar.FormatGNU
header.Name = strings.TrimPrefix(filepath.Clean(fpath), string(filepath.Separator))
header.Name = strings.TrimPrefix(filepath.ToSlash(filepath.Clean(fpath)), "/")
mode := st.Mode()