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

asking for password on stderr instead of stdout so `meteor mongo --url` can be used in scripts #1600

Closed
wants to merge 1 commit into
base: devel
from

Conversation

Projects
None yet
4 participants
@AlexeyMK
Contributor

AlexeyMK commented Nov 13, 2013

meteor mongo --url doesn't work inside of a third-party script.

For example: MONGO_URL=$(meteor mongo --url yoursite.meteor.com) If the site requires a password, deploy.sh asks the user for the password (via stdout). The CLI user never sees the prompt, however, since stdout is being saved into $MONGO_URL.

sudo, among others, solves this problem by requesting the password on stderr (http://www.sudo.ws/repos/sudo/file/900a304f9548/src/tgetpass.c).

I figured out a workaround, but it's pretty ugly - the right thing to do (according to sudo, at least) is just to use stderr for prompts like these.

For context, the script I'm writing: https://github.com/AlexeyMK/meteor-download/blob/master/download.sh

@meteor-bot

This comment has been minimized.

meteor-bot commented Nov 14, 2013

@AlexeyMK: Before we can merge your pull request, you'll need to sign the Meteor Contributor Agreement: https://contribute.meteor.com/

@AlexeyMK

This comment has been minimized.

Contributor

AlexeyMK commented Nov 14, 2013

Already have.
On Nov 13, 2013 4:49 PM, "meteor-bot" notifications@github.com wrote:

@AlexeyMK https://github.com/AlexeyMK: Before we can merge your pull
request, you'll need to sign the Meteor Contributor Agreement:
https://contribute.meteor.com/


Reply to this email directly or view it on GitHubhttps://github.com//pull/1600#issuecomment-28450057
.

@n1mmy

This comment has been minimized.

Member

n1mmy commented Nov 14, 2013

Oops! Sorry about that... silly bot. You're all set =)

@AlexeyMK

This comment has been minimized.

Contributor

AlexeyMK commented Nov 14, 2013

Sweet. So what's next?

@glasser

This comment has been minimized.

Member

glasser commented Nov 19, 2013

Great, merged.

@glasser glasser closed this Nov 19, 2013

estark37 pushed a commit that referenced this pull request Feb 9, 2014

Emily Stark
Use stderr instead of stdout in login command.
This is consistent with old password prompts (see #1600), and also makes
it so that everyone who calls `doInteractivePasswordLogin` is using the
same stream as `doInteractivePasswordLogin`.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment