Skip to content

Conversation

@mcamara
Copy link

@mcamara mcamara commented Sep 18, 2017

For lazy people (as me), copying and pasting the url is too much hassle. With this small fix, the url is automatically open in user's default browser.

Thanks for the good work!

@toniov
Copy link
Owner

toniov commented Sep 18, 2017

Thanks for the PR!

A couple of things:

  • Maybe it's not a good idea to open the browser without asking first (plus it would be a breaking change). Doing it through an option could be a better idea (something like $ gcal generateUrl -o.

  • It needs to be cross-platform, using opn it could be implemented easily.

@mcamara
Copy link
Author

mcamara commented Sep 18, 2017

You're right, I always forget windows users! I'll fix it later!

@mcamara
Copy link
Author

mcamara commented Sep 21, 2017

I've made the changes we talked about. What do you think now? 😸

});
console.log(authUrl);
if (openInBrowser) {
opn(authUrl, { wait: 0 });
Copy link
Owner

Choose a reason for hiding this comment

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

Since we don't wait for the page to be closed I don't think we need this wait option.

switch (command) {
case 'generateUrl': {
await generateUrl();
await generateUrl(argv.o);
Copy link
Owner

Choose a reason for hiding this comment

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

To keep it consistent with the other commands, it would be better to add the non-abbreviated form as well: (argv.open || argv.o).

@toniov
Copy link
Owner

toniov commented Sep 21, 2017

Thanks! Looks good!

Besides the comments, if you add the new option to help.js we are good to go I think!

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.

2 participants