Skip to content

Commit 386a21a

Browse files
committed
fixup: address platform specific archiver issues for now manually
1 parent ce07f4a commit 386a21a

1 file changed

Lines changed: 8 additions & 1 deletion

File tree

internal/unarchive/unarchive.go

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import (
55
"io"
66
"os"
77
"path/filepath"
8+
"strings"
89

910
"github.com/mholt/archiver/v4"
1011
)
@@ -24,8 +25,14 @@ func Unarchive(input io.Reader, dir string) error {
2425
// (leave this nil to walk ALL files from the archive)
2526

2627
handler := func(ctx context.Context, f archiver.File) error {
28+
fileName := f.NameInArchive
29+
// currently on osx we get a top dir of ./bin and ./share
30+
// when in reality the
31+
if strings.HasPrefix(fileName, "quarto-") {
32+
fileName = strings.Join(strings.Split(fileName, "/")[1:], "/")
33+
}
2734
// do something with the file
28-
newPath := filepath.Join(dir, f.NameInArchive)
35+
newPath := filepath.Join(dir, fileName)
2936
if f.IsDir() {
3037
return os.MkdirAll(newPath, f.Mode())
3138
}

0 commit comments

Comments
 (0)