ensure backupFolder is always set

This commit is contained in:
Girish Ramakrishnan
2017-09-19 11:58:20 -07:00
parent 84649b9471
commit 221d5f95e1
3 changed files with 26 additions and 4 deletions

View File

@@ -25,7 +25,6 @@ var assert = require('assert'),
shell = require('../shell.js'),
targz = require('./targz.js');
var FALLBACK_BACKUP_FOLDER = '/var/backups';
var BACKUP_USER = config.TEST ? process.env.USER : 'yellowtent';
// internal only
@@ -35,7 +34,7 @@ function getBackupFilePath(apiConfig, backupId) {
const FILE_TYPE = apiConfig.key ? '.tar.gz.enc' : '.tar.gz';
return path.join(apiConfig.backupFolder || FALLBACK_BACKUP_FOLDER, backupId.endsWith(FILE_TYPE) ? backupId : backupId+FILE_TYPE);
return path.join(apiConfig.backupFolder, backupId.endsWith(FILE_TYPE) ? backupId : backupId+FILE_TYPE);
}
// storage api