Skip to content

Commit dba5534

Browse files
committed
Code formatting & utilise syncronous version of stat
1 parent c4e3681 commit dba5534

1 file changed

Lines changed: 11 additions & 2 deletions

File tree

app/public/js/common/configLocation.js

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,12 @@ const mkdirp = require('mkdirp');
99
*/
1010
const folderExists = folder => {
1111
let exists = false;
12-
fs.stat(folder, (err, stats) => { if (stats.isDirectory()) exists = true; });
12+
fs.statSync(folder, (err, stats) => {
13+
if (stats.isDirectory()) {
14+
exists = true;
15+
}
16+
});
17+
1318
return exists;
1419
};
1520

@@ -40,7 +45,11 @@ class Configuration {
4045
}
4146

4247
if (!folderExists(userConfigPath)) {
43-
mkdirp(userConfigPath, err => { if (err) console.error(err); });
48+
mkdirp(userConfigPath, err => {
49+
if (err) {
50+
console.error(err);
51+
}
52+
});
4453
}
4554

4655
return userConfigPath;

0 commit comments

Comments
 (0)