Skip to content

Commit 71480e4

Browse files
committed
fix: restore folder upload traversal setup
1 parent 2accbbc commit 71480e4

File tree

1 file changed

+9
-6
lines changed

1 file changed

+9
-6
lines changed

adapters/folder/run.go

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -38,26 +38,29 @@ func (ifc *ImportFolderCmd) run(cmd *cobra.Command, args []string, app *app.Appl
3838

3939
ifc.app = app
4040
ifc.processor = app.FileProcessor()
41+
log := app.Log()
4142
ifc.tz = app.GetTZ()
42-
// ifc.InclusionFlags.SetIncludeTypeExtensions()
43+
ifc.InclusionFlags.SetIncludeTypeExtensions()
4344

4445
// parse arguments and generate a fs.FS per argument
45-
ifc.fsyss, err = fshelper.ParsePath(args)
46+
fsyss, err := fshelper.ParsePath(args)
4647
if err != nil {
4748
return err
4849
}
49-
if len(ifc.fsyss) == 0 {
50-
app.Log().Message("No file found matching the pattern: %s", strings.Join(args, ","))
50+
if len(fsyss) == 0 {
51+
log.Message("No file found matching the pattern: %s", strings.Join(args, ","))
5152
return errors.New("No file found matching the pattern: " + strings.Join(args, ","))
5253
}
5354

5455
defer func() {
55-
if err := fshelper.CloseFSs(ifc.fsyss); err != nil {
56+
if err := fshelper.CloseFSs(fsyss); err != nil {
5657
// Handle the error - log it, since we can't return it
57-
app.Log().Error("error closing file systems", "error", err)
58+
log.Error("error closing file systems", "error", err)
5859
}
5960
}()
6061

62+
ifc.fsyss = fsyss
63+
6164
// Start the workers
6265
ifc.pool = worker.NewPool(ifc.app.ConcurrentTask)
6366

0 commit comments

Comments
 (0)