Skip to content

Commit f7f5a19

Browse files
Improve archive renamer and fix failing tests
1 parent 8e0a04c commit f7f5a19

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

v2/pkgs/tools.go

+5-2
Original file line numberDiff line numberDiff line change
@@ -246,8 +246,11 @@ func (t *Tools) Remove(ctx context.Context, payload *tools.ToolPayload) (*tools.
246246
func rename(base string) extract.Renamer {
247247
return func(path string) string {
248248
parts := strings.Split(filepath.ToSlash(path), "/")
249-
path = strings.Join(parts[1:], "/")
250-
path = filepath.Join(base, path)
249+
newPath := strings.Join(parts[1:], "/")
250+
if newPath == "" {
251+
newPath = filepath.Join(newPath, path)
252+
}
253+
path = filepath.Join(base, newPath)
251254
return path
252255
}
253256
}

0 commit comments

Comments
 (0)