storage: add copyDir
we changed listDir in c44863a9bb to list
a directory . this broke copy for files since a '/' is added when listing
the file.
This commit is contained in:
+3
-3
@@ -244,16 +244,16 @@ async function copy(backupTarget, srcRemotePath, destRemotePath, progressCallbac
|
||||
assert.strictEqual(typeof progressCallback, 'function');
|
||||
|
||||
const startTime = new Date();
|
||||
const [copyError] = await safe(backupTargets.storageApi(backupTarget).copy(backupTarget.config, srcRemotePath, destRemotePath, progressCallback));
|
||||
const [copyError] = await safe(backupFormats.api(backupTarget.format).copy(backupTarget, srcRemotePath, destRemotePath, progressCallback));
|
||||
if (copyError) {
|
||||
debug(`copy: copied to ${destRemotePath} errored. error: ${copyError.message}`);
|
||||
debug(`copy: copy to ${destRemotePath} errored. error: ${copyError.message}`);
|
||||
throw copyError;
|
||||
}
|
||||
debug(`copy: copied successfully to ${destRemotePath}. Took ${(new Date() - startTime)/1000} seconds`);
|
||||
|
||||
const [copyChecksumError] = await safe(backupTargets.storageApi(backupTarget).copy(backupTarget.config, `${srcRemotePath}.backupinfo`, `${destRemotePath}.backupinfo`, progressCallback));
|
||||
if (copyChecksumError) {
|
||||
debug(`copy: copied to ${destRemotePath} errored. error: ${copyChecksumError.message}`);
|
||||
debug(`copy: copy to ${destRemotePath} errored. error: ${copyChecksumError.message}`);
|
||||
throw copyChecksumError;
|
||||
}
|
||||
debug(`copy: copied backupinfo successfully to ${destRemotePath}.backupinfo`);
|
||||
|
||||
Reference in New Issue
Block a user