Skip to content

Commit

Permalink
Fix import issue on linux server when using cli from windows
Browse files Browse the repository at this point in the history
  • Loading branch information
chamilaadhi committed Nov 14, 2019
1 parent 337f5d7 commit 1c9eb97
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
Expand Up @@ -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
Expand Down

0 comments on commit 1c9eb97

Please sign in to comment.