chore(fs/S3#_rmdir): use _isNotEmptyDir
This commit is contained in:
parent
cb835b7b6a
commit
5f53ebdf12
@ -171,8 +171,7 @@ export default class S3Handler extends RemoteHandlerAbstract {
|
|||||||
}
|
}
|
||||||
|
|
||||||
async _rmdir(path) {
|
async _rmdir(path) {
|
||||||
const entries = await this._list(path)
|
if (await this._isNotEmptyDir(path)) {
|
||||||
if (entries.length !== 0) {
|
|
||||||
const error = new Error(`ENOTEMPTY: directory not empty, rmdir '${path}`)
|
const error = new Error(`ENOTEMPTY: directory not empty, rmdir '${path}`)
|
||||||
error.code = 'ENOTEMPTY'
|
error.code = 'ENOTEMPTY'
|
||||||
error.path = path
|
error.path = path
|
||||||
|
Loading…
Reference in New Issue
Block a user