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:
@@ -271,6 +271,15 @@ async function upload(backupTarget, remotePath, dataLayout, progressCallback) {
|
||||
});
|
||||
}
|
||||
|
||||
async function copy(backupTarget, fromPath, toPath, progressCallback) {
|
||||
assert.strictEqual(typeof backupTarget, 'object');
|
||||
assert.strictEqual(typeof fromPath, 'string');
|
||||
assert.strictEqual(typeof toPath, 'string');
|
||||
assert.strictEqual(typeof progressCallback, 'function');
|
||||
|
||||
await backupTargets.storageApi(backupTarget).copy(backupTarget.config, fromPath, toPath, progressCallback);
|
||||
}
|
||||
|
||||
async function verify(backupTarget, remotePath, integrityMap, progressCallback) {
|
||||
assert.strictEqual(typeof backupTarget, 'object');
|
||||
assert.strictEqual(typeof remotePath, 'string');
|
||||
@@ -340,6 +349,7 @@ exports = module.exports = {
|
||||
upload,
|
||||
verify,
|
||||
getFileExtension,
|
||||
copy,
|
||||
|
||||
// exported for testing
|
||||
_EnsureFileSizeStream: EnsureFileSizeStream
|
||||
|
||||
Reference in New Issue
Block a user