We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent ce07f4a commit 386a21aCopy full SHA for 386a21a
1 file changed
internal/unarchive/unarchive.go
@@ -5,6 +5,7 @@ import (
5
"io"
6
"os"
7
"path/filepath"
8
+ "strings"
9
10
"github.com/mholt/archiver/v4"
11
)
@@ -24,8 +25,14 @@ func Unarchive(input io.Reader, dir string) error {
24
25
// (leave this nil to walk ALL files from the archive)
26
27
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
+ }
34
// do something with the file
- newPath := filepath.Join(dir, f.NameInArchive)
35
+ newPath := filepath.Join(dir, fileName)
36
if f.IsDir() {
37
return os.MkdirAll(newPath, f.Mode())
38
}
0 commit comments