-
Notifications
You must be signed in to change notification settings - Fork 31
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
generateUrl opens browser automatically #5
base: master
Are you sure you want to change the base?
Conversation
Thanks for the PR! A couple of things:
|
You're right, I always forget windows users! I'll fix it later! |
I've made the changes we talked about. What do you think now? 😸 |
const oauth2Client = getOauth2Client(); | ||
const authUrl = oauth2Client.generateAuthUrl({ | ||
access_type: 'offline', | ||
scope: conf.SCOPES | ||
}); | ||
console.log(authUrl); | ||
if (openInBrowser) { | ||
opn(authUrl, { wait: 0 }); |
There was a problem hiding this comment.
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.
@@ -249,7 +253,7 @@ console.log(argv); | |||
} | |||
switch (command) { | |||
case 'generateUrl': { | |||
await generateUrl(); | |||
await generateUrl(argv.o); |
There was a problem hiding this comment.
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)
.
Thanks! Looks good! Besides the comments, if you add the new option to help.js we are good to go I think! |
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!