Skip to content

Commit

Permalink
Merge pull request #140 from chamilaadhi/2.x.x
Browse files Browse the repository at this point in the history
Fix import issue on linux server when using cli from windows
chamilaadhi authored Nov 15, 2019
2 parents 337f5d7 + 1c9eb97 commit c6d0ab0
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion import-export-cli/utils/zipUtils.go
Original file line number Diff line number Diff line change
@@ -66,7 +66,10 @@ func Zip(source, target string) error {
// If baseDir is not empty it means we need to strip source from path, so we can get a relative filename from
// base.
if baseDir != "" {
header.Name = filepath.Join(baseDir, strings.TrimPrefix(path, source))
// Replace system specific path seperator with forward slash '/' as the separator as required by the
// ZIP spec (4.4.17.1) https://pkware.cachefly.net/webdocs/casestudies/APPNOTE.TXT
var resource string = filepath.Join(baseDir, strings.TrimPrefix(path, source))
header.Name = strings.ReplaceAll(resource, string(filepath.Separator), "/")
}
if info.IsDir() {
// add directory to zip archive

0 comments on commit c6d0ab0

Please sign in to comment.