filesystem: remove hook should not rm recursively
this causes a bug in the backupcleaner when it tries to prune empty directories when using the filesystem backend. the bug is hit when a box backup is getting cleaned up but one or more app backups are preserved.
This commit is contained in:
@@ -201,7 +201,7 @@ async function remove(apiConfig, filename) {
|
||||
if (stat.isFile()) {
|
||||
if (!safe.fs.unlinkSync(filename)) throw new BoxError(BoxError.EXTERNAL_ERROR, safe.error.message);
|
||||
} else if (stat.isDirectory()) {
|
||||
if (!safe.fs.rmSync(filename, { recursive: true })) throw new BoxError(BoxError.EXTERNAL_ERROR, safe.error.message);
|
||||
if (!safe.fs.rmdirSync(filename, { recursive: false })) throw new BoxError(BoxError.EXTERNAL_ERROR, safe.error.message);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user