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

Replace all concatenated paths with Node's path.join #307

Merged
merged 6 commits into from
May 22, 2016

Conversation

astorije
Copy link
Member

@astorije astorije commented May 8, 2016

My attempt at fixing #301.

Let me know if this solution is crappy or should be improved, I don't claim this is the one solution and I'm happy to get feedback. Also, I hope I didn't forget anything.

@astorije astorije added the Type: Feature Tickets that describe a desired feature or PRs that add them to the project. label May 8, 2016
function getConfig() {
return require(path.resolve(this.HOME) + "/config");
return require(path.resolve(this.CONFIG_PATH));
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove path.resolve here.

@astorije astorije force-pushed the astorije/path-join-everywhere branch from c8df0d6 to d946286 Compare May 8, 2016 18:22
@astorije
Copy link
Member Author

astorije commented May 8, 2016

@xPaw, I believe I have addressed all your comments.

However, this PR needs a lot of testing. I have done some, but definitely happy to have others test too. If done badly, this can create and use config in wrong directories, so people would believe their config was wiped.

if (!fs.existsSync(config)) {
mkdirp.sync(Helper.HOME, {mode: "0700"});
fs.writeFileSync(
config,
fs.readFileSync(__dirname + "/../../defaults/config.js")
fs.readFileSync(path.resolve(path.join(
__dirname,
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This uses something else, I'm thinking the goal is the same. Should we stick with one or the other?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

__dirname is correct.

@astorije astorije added the Meta: Do Not Merge This PR should not be merged. label May 8, 2016
@xPaw
Copy link
Member

xPaw commented May 9, 2016

Okay, I've fixed --home. It also correctly expands ~ if specified.

@xPaw xPaw removed the Meta: Do Not Merge This PR should not be merged. label May 9, 2016
@xPaw xPaw force-pushed the astorije/path-join-everywhere branch from a96bfbb to f955aa1 Compare May 9, 2016 16:35
@xPaw xPaw mentioned this pull request May 12, 2016
@xPaw xPaw added this to the ★ Next Release milestone May 13, 2016
@astorije astorije force-pushed the astorije/path-join-everywhere branch from f955aa1 to ad65915 Compare May 15, 2016 20:55
@astorije astorije force-pushed the astorije/path-join-everywhere branch from ad65915 to d6f2def Compare May 15, 2016 21:03
@astorije astorije force-pushed the astorije/path-join-everywhere branch from c1977d1 to ca06e63 Compare May 15, 2016 21:22
@astorije
Copy link
Member Author

Alright, I'm all set with this PR! (Removing second review needed because I made changes since @xPaw's additions).

@thelounge/maintainers, could you review and test this please? :-)

@AlMcKinlay
Copy link
Member

Review looks fine, but I'll set it up so I can test it tomorrow probably (quite busy tonight).

@astorije
Copy link
Member Author

@maxpoulin64, do you mind giving this a review as well?

@maxpoulin64 maxpoulin64 merged commit fca941e into master May 22, 2016
@maxpoulin64 maxpoulin64 deleted the astorije/path-join-everywhere branch May 22, 2016 02:22
matburnham pushed a commit to matburnham/lounge that referenced this pull request Sep 6, 2017
…erywhere

Replace all concatenated paths with Node's path.join
@xPaw xPaw removed their assignment Mar 12, 2018
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