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

Add "env" command #18

Merged
merged 2 commits into from
Jan 13, 2017
Merged

Add "env" command #18

merged 2 commits into from
Jan 13, 2017

Conversation

mraerino
Copy link
Member

Improvement of developer experience

This command takes the environment variables from netlify and writes them either to stdout or to a file.
It should be especially useful for people using dotenv locally, because the output uses dotenv compatible syntax.

.command("env")
.description("Output configured env variables")
.option("-s --site-id [id]", "Fetch from site with <id>")
.option("-f --file [filename]", "Save to file called <filename>")
Copy link
Member

Choose a reason for hiding this comment

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

I think cutting this is better. It simplifies the code. You can just use a redirect b/c this is a cli

Copy link
Member Author

Choose a reason for hiding this comment

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

Unfortunately the site selection ui uses stdOut, so if I redirect the output without passing a site id I don't get the site selection ui in my terminal.
This should happen on stdErr, but since this would require large amounts of re-structuring, I solved it this way.

@mraerino
Copy link
Member Author

@rybit have you considered my last comment?

@rybit rybit merged commit da3fa44 into netlify:master Jan 13, 2017
@rybit
Copy link
Member

rybit commented Jan 13, 2017

Sorry for the delay - yeah it totally sounds good.

bcomnes added a commit that referenced this pull request Aug 16, 2018
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.

None yet

2 participants