Skip to content

Commit

Permalink
(bluefox) leave backitup enabled after restore
Browse files Browse the repository at this point in the history
  • Loading branch information
GermanBluefox committed Aug 19, 2018
1 parent 9b20d6d commit 6bdef64
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions lib/setup/setupBackup.js
Original file line number Diff line number Diff line change
Expand Up @@ -313,7 +313,9 @@ function BackupRestore(options) {

function _setObjHelper(_index, _objects, callback) {
// Disable all adapters.
if (_objects[_index].id.match(/^system\.adapter\./) && !_objects[_index].id.match(/^system\.adapter\.admin/)) {
if (_objects[_index].id.match(/^system\.adapter\./)
&& !_objects[_index].id.match(/^system\.adapter\.admin\./)
&& !_objects[_index].id.match(/^system\.adapter\.backitup\./)) {
if (_objects[_index].doc.common && _objects[_index].doc.common.enabled) {
_objects[_index].doc.common.enabled = false;
}
Expand Down Expand Up @@ -562,10 +564,11 @@ function BackupRestore(options) {
if (!options.cleanDatabase) throw 'Invalid arguments: cleanDatabase is missing';
if (!options.restartController) throw 'Invalid arguments: restartController is missing';

if (parseInt(name, 10).toString() === name.toString()) {
// If number
if (parseInt(name.trim(), 10).toString() === name.trim().toString()) {
backups = this.listBackups();
backups.sort((a, b) => b > a);
name = backups[parseInt(name, 10)];
name = backups[parseInt(name.trim(), 10)];
console.log('host.' + hostname + ' Using backup file ' + name);
}

Expand Down

0 comments on commit 6bdef64

Please sign in to comment.