backups: encrypted backups must have .enc extension

This commit is contained in:
Girish Ramakrishnan
2023-07-24 22:25:06 +05:30
parent febac9e8ca
commit 3d5c21d9ca
7 changed files with 28 additions and 42 deletions

View File

@@ -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) {