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

use token from package settings before checking environment variable #374

Merged
merged 1 commit into from
Aug 29, 2017

Conversation

dirk-thomas
Copy link
Contributor

Fixes #366.

@woneill
Copy link

woneill commented Aug 1, 2017

I think this is actually the wrong approach. Normally one expects environment variables to override settings. Perhaps a better approach would be to rename the variables to something more application specific such as SYNC_SETTINGS_GITHUB_TOKEN and SYNC_SETTINGS_GIST_ID to avoid conflict?

Then if they are indeed the same, people can have their shell config do something like
export SYNC_SETTINGS_GITHUB_TOKEN="$GITHUB _TOKEN"

@dirk-thomas
Copy link
Contributor Author

@woneill I disagree with you on a generic environment variable like GITHUB_TOKEN. The user might have the variable set for many reasons. If he wants a specific token to be used for sync-settings that should be possible by setting the config setting of the package. The package on the other hand can't insist that the user has to change the existing environment variable to avoid conflict.

For a variable like SYNC_SETTINGS_GITHUB_TOKEN that would be a different story imo. For that I understand you rational that it could be used to override the package settings.

@dirk-thomas dirk-thomas merged commit 368895d into master Aug 29, 2017
@dirk-thomas dirk-thomas deleted the use_config_token_before_env_var branch August 29, 2017 01:35
@gluons
Copy link

gluons commented Aug 29, 2017

It should be great if it's more specific 😃

  • SYNC_SETTINGS_GIST_ID => ATOM_SYNC_SETTINGS_GIST_ID

    ⚠️ Maybe some user may use multiple IDE or some app that's using sync settings by Gist.
    It should be safe to avoid conflict and unexpected setting overwritten.

  • And maybe SYNC_SETTINGS_GITHUB_TOKEN => ATOM_SYNC_SETTINGS_GITHUB_TOKEN
    // But we can use 1 token for multiple Gist 🤔

@dirk-thomas
Copy link
Contributor Author

@gluons Please feel free to provide a PR adding support for considering these additional environment variables.

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.

3 participants