File tree Expand file tree Collapse file tree 1 file changed +6
-3
lines changed Expand file tree Collapse file tree 1 file changed +6
-3
lines changed Original file line number Diff line number Diff line change @@ -313,7 +313,9 @@ function BackupRestore(options) {
313313
314314 function _setObjHelper ( _index , _objects , callback ) {
315315 // Disable all adapters.
316- if ( _objects [ _index ] . id . match ( / ^ s y s t e m \. a d a p t e r \. / ) && ! _objects [ _index ] . id . match ( / ^ s y s t e m \. a d a p t e r \. a d m i n / ) ) {
316+ if ( _objects [ _index ] . id . match ( / ^ s y s t e m \. a d a p t e r \. / )
317+ && ! _objects [ _index ] . id . match ( / ^ s y s t e m \. a d a p t e r \. a d m i n \. / )
318+ && ! _objects [ _index ] . id . match ( / ^ s y s t e m \. a d a p t e r \. b a c k i t u p \. / ) ) {
317319 if ( _objects [ _index ] . doc . common && _objects [ _index ] . doc . common . enabled ) {
318320 _objects [ _index ] . doc . common . enabled = false ;
319321 }
@@ -562,10 +564,11 @@ function BackupRestore(options) {
562564 if ( ! options . cleanDatabase ) throw 'Invalid arguments: cleanDatabase is missing' ;
563565 if ( ! options . restartController ) throw 'Invalid arguments: restartController is missing' ;
564566
565- if ( parseInt ( name , 10 ) . toString ( ) === name . toString ( ) ) {
567+ // If number
568+ if ( parseInt ( name . trim ( ) , 10 ) . toString ( ) === name . trim ( ) . toString ( ) ) {
566569 backups = this . listBackups ( ) ;
567570 backups . sort ( ( a , b ) => b > a ) ;
568- name = backups [ parseInt ( name , 10 ) ] ;
571+ name = backups [ parseInt ( name . trim ( ) , 10 ) ] ;
569572 console . log ( 'host.' + hostname + ' Using backup file ' + name ) ;
570573 }
571574
You can’t perform that action at this time.
0 commit comments