backups: encrypted backups must have .enc extension
This commit is contained in:
@@ -138,17 +138,15 @@ function upload(apiConfig, backupFilePath, sourceStream, callback) {
|
||||
});
|
||||
}
|
||||
|
||||
function download(apiConfig, sourceFilePath, callback) {
|
||||
async function download(apiConfig, sourceFilePath) {
|
||||
assert.strictEqual(typeof apiConfig, 'object');
|
||||
assert.strictEqual(typeof sourceFilePath, 'string');
|
||||
assert.strictEqual(typeof callback, 'function');
|
||||
|
||||
debug(`download: ${sourceFilePath}`);
|
||||
|
||||
if (!safe.fs.existsSync(sourceFilePath)) return callback(new BoxError(BoxError.NOT_FOUND, `File not found: ${sourceFilePath}`));
|
||||
if (!safe.fs.existsSync(sourceFilePath)) throw new BoxError(BoxError.NOT_FOUND, `File not found: ${sourceFilePath}`);
|
||||
|
||||
var fileStream = fs.createReadStream(sourceFilePath);
|
||||
callback(null, fileStream);
|
||||
return fs.createReadStream(sourceFilePath);
|
||||
}
|
||||
|
||||
async function exists(apiConfig, sourceFilePath) {
|
||||
|
||||
Reference in New Issue
Block a user