feat: dir and file check

This commit is contained in:
Noah Hsu
2022-06-23 16:09:22 +08:00
parent d77dea733f
commit b971b13362
4 changed files with 26 additions and 11 deletions

View File

@ -26,6 +26,9 @@ func List(ctx context.Context, account driver.Driver, path string, refresh ...bo
if err != nil {
return nil, errors.WithMessage(err, "failed get dir")
}
if !dir.IsDir() {
return nil, errors.WithStack(errs.NotFolder)
}
if account.Config().NoCache {
return account.List(ctx, dir)
}