-
Notifications
You must be signed in to change notification settings - Fork 687
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Supersede mkdirp with fs-extra #390
Conversation
@@ -52,7 +51,6 @@ ClientManager.prototype.loadUser = function(name) { | |||
|
|||
ClientManager.prototype.getUsers = function() { | |||
var users = []; | |||
mkdirp.sync(Helper.USERS_PATH); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since you removed these syncs from clientManager, can you add one in command-line/index.js
after ensuring CONFIG_PATH
folder?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
var Helper = require("../helper"); | ||
|
||
program | ||
.command("add <name>") | ||
.description("Add a new user") | ||
.action(function(name/* , password */) { | ||
try { | ||
mkdirp.sync(Helper.USERS_PATH); | ||
fsextra.ensureDirSync(Helper.USERS_PATH); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is ensured in index.js
, so there's no need to do it again in the add command (remove the try/catch completely).
Ensure USERS_PATH exists at start. Remove unnecessary USER_PATH check. Use fs-extra's copy to write default config.
👍 |
Damn, this was merged before I had time to review (which is why I had assigned to myself), oh well. |
Supersede mkdirp with fs-extra
Implements #380.
Sorry about the duplicate pull requests.