Skip to content

Commit

Permalink
fix: windows separator is not consistent with zip
Browse files Browse the repository at this point in the history
  • Loading branch information
Yeuoly committed Dec 18, 2024
1 parent 1441bd6 commit d039751
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions internal/core/plugin_packager/packager/packager.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import (
"errors"
"path/filepath"
"strconv"
"strings"

"github.com/langgenius/dify-plugin-daemon/internal/core/plugin_packager/decoder"
)
Expand Down Expand Up @@ -45,6 +46,10 @@ func (p *Packager) Pack(maxSize int64) ([]byte, error) {
return errors.New("plugin package size is too large, please ensure the uncompressed size is less than " + strconv.FormatInt(maxSize, 10) + " bytes")
}

// ISSUES: Windows path separator is \, but zip requires /, to avoid this we just simply replace all \ with / for now
// TODO: find a better solution
fullPath = strings.ReplaceAll(fullPath, "\\", "/")

zipFile, err := zipWriter.Create(fullPath)
if err != nil {
return err
Expand Down

0 comments on commit d039751

Please sign in to comment.