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

Move org loader to module and execute inside of run() functions #16

Open
kevinohara80 opened this issue Oct 29, 2015 · 0 comments
Open

Comments

@kevinohara80
Copy link
Owner

The reason why each command module exports separate run() and cli() functions is so that the run() function can be easily consumed by a non-cli application. Currently, the cli manages taking an org argument and using it to resolve the proper stored oauth data and passed that oauth data into the run function as an options property.

Therefore, if a non-cli application is consuming the run() method, it must provide the oauth data and can't take advantage of the internal oauth/login management of dmc.

I propose that we move this org loading logic to a module that is called within each run() method for commands that require Salesforce communication. I think the api for the run method should support either (a) the org argument, (b) the oauth argument, or (c) neither that results in falling back to default orgs in the configuration. The loader would handle the negotiation of the arguments to figure out how to return the required oauth.

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

No branches or pull requests

1 participant