File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -14,6 +14,18 @@ const configuration = {
1414 } ) ;
1515 } ,
1616
17+ createIfNotExist ( path ) {
18+ try {
19+ const pathInfo = fs . statSync ( path ) ;
20+ if ( ! pathInfo . isDirectory ( ) ) {
21+ this . createUserConfig ( path ) ;
22+ }
23+ }
24+ catch ( error ) {
25+ this . createUserConfig ( path ) ;
26+ }
27+ } ,
28+
1729 /**
1830 * Get the configuration folder location
1931 *
@@ -42,17 +54,8 @@ const configuration = {
4254 throw `could not set config path for this OS ${ process . platform } `
4355 }
4456
45- // create user config in path
46- // if there is no userConfig path
47- try {
48- const configFileInfo = fs . statSync ( userConfigPath ) ;
49- if ( ! configFileInfo . isDirectory ( ) ) {
50- this . createUserConfig ( userConfigPath ) ;
51- }
52- }
53- catch ( error ) {
54- this . createUserConfig ( userConfigPath ) ;
55- }
57+ createIfNotExist ( userConfigPath )
58+
5659 return userConfigPath ;
5760 } ,
5861
You can’t perform that action at this time.
0 commit comments