Skip to content
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

Merged
merged 1 commit into from
Jun 11, 2016
Merged

Supersede mkdirp with fs-extra #390

merged 1 commit into from
Jun 11, 2016

Conversation

daniel-tp
Copy link
Contributor

Implements #380.

Sorry about the duplicate pull requests.

@astorije astorije self-assigned this Jun 10, 2016
@astorije astorije added the Type: Feature Tickets that describe a desired feature or PRs that add them to the project. label Jun 10, 2016
@@ -52,7 +51,6 @@ ClientManager.prototype.loadUser = function(name) {

ClientManager.prototype.getUsers = function() {
var users = [];
mkdirp.sync(Helper.USERS_PATH);
Copy link
Member

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?

Copy link
Contributor Author

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);
Copy link
Member

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.
@xPaw
Copy link
Member

xPaw commented Jun 11, 2016

👍

@maxpoulin64 maxpoulin64 merged commit ee0ebdc into thelounge:master Jun 11, 2016
@xPaw xPaw added this to the 2.0.0 milestone Jun 12, 2016
@astorije
Copy link
Member

Damn, this was merged before I had time to review (which is why I had assigned to myself), oh well.

@astorije astorije assigned xPaw and maxpoulin64 and unassigned astorije Jun 12, 2016
matburnham pushed a commit to matburnham/lounge that referenced this pull request Sep 6, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Feature Tickets that describe a desired feature or PRs that add them to the project.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants