Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix import issue on linux server when using cli from windows #140

Merged
merged 1 commit into from
Nov 15, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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