Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Use method in favour of commented block.
  • Loading branch information
JackMordaunt committed Jan 3, 2018
commit 626d4419b10e13708514d53a5d8860eca4042385
25 changes: 14 additions & 11 deletions app/public/js/common/configLocation.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,18 @@ const configuration = {
});
},

createIfNotExist(path) {
try {
const pathInfo = fs.statSync(path);
if (!pathInfo.isDirectory()) {
this.createUserConfig(path);
}
}
catch(error) {
this.createUserConfig(path);
}
},

/**
* Get the configuration folder location
*
Expand Down Expand Up @@ -42,17 +54,8 @@ const configuration = {
throw `could not set config path for this OS ${process.platform}`
}

// create user config in path
// if there is no userConfig path
try {
const configFileInfo = fs.statSync(userConfigPath);
if (!configFileInfo.isDirectory()) {
this.createUserConfig(userConfigPath);
}
}
catch(error) {
this.createUserConfig(userConfigPath);
}
createIfNotExist(userConfigPath)

return userConfigPath;
},

Expand Down