chore: update dfget recursive log (#2459)

Signed-off-by: Jim Ma <majinjing3@gmail.com>
This commit is contained in:
Jim Ma 2023-06-15 11:19:33 +08:00 committed by Gaius
parent 9137707139
commit bb29a234f4
No known key found for this signature in database
GPG Key ID: 8B4E5D1290FA2FFB
1 changed files with 17 additions and 15 deletions

View File

@ -356,8 +356,12 @@ func recursiveDownload(ctx context.Context, client dfdaemonclient.V1, cfg *confi
continue continue
} }
logger.Infof("download %s to %s", childCfg.URL, childCfg.Output) if urlEntry.IsDir {
if !urlEntry.IsDir { logger.Infof("download directory %s to %s", childCfg.URL, childCfg.Output)
queue.PushBack(&childCfg)
continue
}
if childCfg.RecursiveList { if childCfg.RecursiveList {
continue continue
} }
@ -367,12 +371,10 @@ func recursiveDownload(ctx context.Context, client dfdaemonclient.V1, cfg *confi
logger.Errorf("validate failed: %s", err) logger.Errorf("validate failed: %s", err)
return err return err
} }
if err := singleDownload(ctx, client, &childCfg, logger.With("url", childCfg.URL)); err != nil { logger.Infof("download file %s to %s", childCfg.URL, childCfg.Output)
if err = singleDownload(ctx, client, &childCfg, logger.With("url", childCfg.URL)); err != nil {
return err return err
} }
} else {
queue.PushBack(&childCfg)
}
} }
} }
return nil return nil