storage: make copy async
This commit is contained in:
@@ -92,16 +92,13 @@ function downloadDir(apiConfig, backupFilePath, destDir) {
|
||||
return events;
|
||||
}
|
||||
|
||||
function copy(apiConfig, oldFilePath, newFilePath) {
|
||||
async function copy(apiConfig, oldFilePath, newFilePath, progressCallback) {
|
||||
assert.strictEqual(typeof apiConfig, 'object');
|
||||
assert.strictEqual(typeof oldFilePath, 'string');
|
||||
assert.strictEqual(typeof newFilePath, 'string');
|
||||
assert.strictEqual(typeof progressCallback, 'function');
|
||||
|
||||
debug('copy: %s -> %s', oldFilePath, newFilePath);
|
||||
|
||||
var events = new EventEmitter();
|
||||
process.nextTick(function () { events.emit('done', null); });
|
||||
return events;
|
||||
debug(`copy: ${oldFilePath} -> ${newFilePath}`);
|
||||
}
|
||||
|
||||
async function remove(apiConfig, filename) {
|
||||
|
||||
Reference in New Issue
Block a user