Skip to content

Commit 626d441

Browse files
committed
Use method in favour of commented block.
1 parent cb57908 commit 626d441

1 file changed

Lines changed: 14 additions & 11 deletions

File tree

app/public/js/common/configLocation.js

Lines changed: 14 additions & 11 deletions
Original file line numberDiff line numberDiff 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

0 commit comments

Comments
 (0)