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

fix(circle): always prompt for CircleCI API token #278

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 1 addition & 11 deletions src/lib/circle.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ const circleConfig = {
},
};

function getUserInput(info) {
function getUserInput(/* info */) {
return inquirer.prompt([
{
type: 'input',
Expand All @@ -44,16 +44,6 @@ function getUserInput(info) {
const clipboardValue = await clipboard.read();
return clipboardValue.length === 40 ? clipboardValue : null;
},
when: () => {
try {
return info.options['ask-for-passwords'];
} catch (error) {
info.log.error(
'Something went wrong with your stored api token. Delete them from your keychain and try again'
);
process.exit(1); // eslint-disable-line unicorn/no-process-exit
}
},
Copy link
Member

Choose a reason for hiding this comment

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

I don't quite understand how that change relates to the title of the pull request?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

currently it only prompts for the CircleCI API token when info.options['ask-for-passwords'] is truthy. This change removes that and makes sure it will always prompt for the CircleCI API token, regardless of the ask-for-passwords option (which is not used by anything else anymore). As I mentioned in #277, if it doesn't prompt for the CircleCI API token, it fails with a cryptic error following repo on CircleCI! message.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks a bunch for getting my PRs merged!

},
{
type: 'confirm',
Expand Down