File tree Expand file tree Collapse file tree 1 file changed +11
-6
lines changed Expand file tree Collapse file tree 1 file changed +11
-6
lines changed Original file line number Diff line number Diff line change @@ -11,11 +11,11 @@ function BackupRestore(options) {
1111
1212 options = options || { } ;
1313
14- if ( ! options . states ) throw " Invalid arguments: states is missing" ;
15- if ( ! options . objects ) throw " Invalid arguments: objects is missing" ;
16- if ( ! options . processExit ) throw " Invalid arguments: processExit is missing" ;
17- if ( ! options . cleanDatabase ) throw " Invalid arguments: cleanDatabase is missing" ;
18- if ( ! options . restartController ) throw " Invalid arguments: restartController is missing" ;
14+ if ( ! options . states ) throw ' Invalid arguments: states is missing' ;
15+ if ( ! options . objects ) throw ' Invalid arguments: objects is missing' ;
16+ if ( ! options . processExit ) throw ' Invalid arguments: processExit is missing' ;
17+ if ( ! options . cleanDatabase ) throw ' Invalid arguments: cleanDatabase is missing' ;
18+ if ( ! options . restartController ) throw ' Invalid arguments: restartController is missing' ;
1919
2020 var objects = options . objects ;
2121 var states = options . states ;
@@ -96,9 +96,14 @@ function BackupRestore(options) {
9696 }
9797
9898 name = name . replace ( / \\ / g, '/' ) ;
99- if ( name . indexOf ( '/' ) == - 1 ) {
99+ if ( name . indexOf ( '/' ) === - 1 ) {
100100 var path = getBackupDir ( ) ;
101101
102+ // create directory if not exists
103+ if ( ! fs . existsSync ( path ) ) {
104+ fs . mkdirSync ( path ) ;
105+ }
106+
102107 if ( name . indexOf ( '.tar.gz' ) == - 1 ) {
103108 name = path + name + '.tar.gz' ;
104109 } else {
You can’t perform that action at this time.
0 commit comments