data dir: allow sameness of old and new dir
this makes it easy to migrate to a new volume setup
This commit is contained in:
@@ -512,7 +512,7 @@ async function checkStorage(app, volumeId, prefix) {
|
||||
const rel = path.relative(sourceDir, targetDir);
|
||||
if (!rel.startsWith('../') && rel.split('/').length > 1) throw new BoxError(BoxError.BAD_FIELD, 'Only one level subdirectory moves are supported');
|
||||
|
||||
const [error] = await safe(shell.promises.sudo('checkStorage', [ CHECKVOLUME_CMD, targetDir ], {}));
|
||||
const [error] = await safe(shell.promises.sudo('checkStorage', [ CHECKVOLUME_CMD, targetDir, sourceDir ], {}));
|
||||
if (error && error.code === 2) throw new BoxError(BoxError.BAD_FIELD, `Target directory ${targetDir} is not empty`);
|
||||
if (error && error.code === 3) throw new BoxError(BoxError.BAD_FIELD, `Target directory ${targetDir} does not support chown`);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user