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 the import of files with wildcard in the path #161

Merged
merged 2 commits into from
Sep 13, 2021
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
28 changes: 24 additions & 4 deletions pkg/config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -373,11 +373,31 @@ func (f *File) expandFiles(dir string) (err error, files []*File) {
return err, files
}

for _, name := range fileNames {
eachConf := f
eachConf.Path = &name
if len(fileNames) == 1 {
files = append(files, f)
return err, files
}

for i := range fileNames {
var failedDataPath *string = nil
if f.FailDataPath != nil {
base := filepath.Base(fileNames[i])
tmp := filepath.Join(*f.FailDataPath, base)
failedDataPath = &tmp
logger.Infof("Failed data path: %v", *failedDataPath)
}
eachConf := &File{
Path: &fileNames[i],
FailDataPath: failedDataPath,
BatchSize: f.BatchSize,
Limit: f.Limit,
InOrder: f.InOrder,
Type: f.Type,
CSV: f.CSV,
Schema: f.Schema,
}
files = append(files, eachConf)
logger.Infof("find file: %v", *f.Path)
logger.Infof("find file: %v", *eachConf.Path)
}
}

Expand Down