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

[NEW] Default servers improvements #490

Merged
merged 12 commits into from
Aug 7, 2017
Merged

[NEW] Default servers improvements #490

merged 12 commits into from
Aug 7, 2017

Conversation

gdelavald
Copy link
Contributor

@RocketChat/core

Closes #455
Based on Pull Request #471 from @localguru (Thank you so much for this)
Synced with develop to fix the CI build and did a small refactor on the code.

@gdelavald
Copy link
Contributor Author

Seems like the process.cwd() can't be fully trusted when the app is packaged, to get the actual path Electron provides getAppPath() method on the API, as listed here.

@RocketChat RocketChat deleted a comment Jul 31, 2017
@RocketChat RocketChat deleted a comment Jul 31, 2017
@RocketChat RocketChat deleted a comment Jul 31, 2017
@RocketChat RocketChat deleted a comment Jul 31, 2017
@RocketChat RocketChat deleted a comment Jul 31, 2017
@gdelavald
Copy link
Contributor Author

I'll hang on to this until we find a solution that suits the comments on PR #312, based on installation time server configuration.

@gdelavald
Copy link
Contributor Author

I'm happy with the current state of this PR. I tested in several use cases with both Mac and Windows versions, I need to do some testing for linux distros, but it should be working as intended afaik.

@@ -65,10 +65,13 @@ class Servers extends EventEmitter {

// Load server info from server config file
if (Object.keys(hosts).length === 0) {
const serverFileName = 'servers.json';
const userDataDir = jetpack.cwd(remote.app.getPath('userData'));
const pathToServerJson = jetpack.path(
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Now we check the user APPDATA folder first, then the system installation folder (for /allusers) and then the packaged file (if we do a branded package).

@gdelavald gdelavald modified the milestone: 2.9.0 Aug 2, 2017
@gdelavald gdelavald merged commit 553a4e5 into develop Aug 7, 2017
@gdelavald gdelavald deleted the servers-json-improve branch August 7, 2017 13:56
@localguru
Copy link
Contributor

+1 THANKS!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

servers.json and /allusers setup
2 participants