Skip to content

Commit

Permalink
windows fix
Browse files Browse the repository at this point in the history
  • Loading branch information
dvaumoron committed Jun 4, 2024
1 parent bc8edce commit 364c6a2
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions pkg/uncompress/zip/zip.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ import (
"bytes"
"io"
"os"
"strings"

"github.com/dvaumoron/lastgo/pkg/sanitize"
)
Expand Down Expand Up @@ -50,9 +51,8 @@ func copyZipFileToDir(zipFile *zip.File, dirPath string) error {
return err
}

if destPath[len(destPath)-1] == '/' {
// trailing slash indicates a directory
return os.MkdirAll(destPath, 0755)
if err = os.MkdirAll(destPath[:strings.LastIndex(destPath, string(os.PathSeparator))], 0755); err != nil {
return err
}

reader, err := zipFile.Open()
Expand Down

0 comments on commit 364c6a2

Please sign in to comment.