Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
.then(function (profile) {
console.log('You already have the `' + argv.profile
+ '` profile:');
printProfile(argv.profile, profile);
return Promptly.confirmAsync('Do you want to override it? [y/N]', {
'default': false,
})
.then(function (override) {
if (!override)
throw Boom.conflict('User chose not to override '
+ 'existing profile.', profile);
});
})
.catch(function (e) {
.catch(function (err) {
console.log(('We were unable to verify your identity.').red);
return Promptly.confirmAsync('Would you like to try again? [Y/n]', {
'default': true,
})
.then(function (tryAgain) {
if (!tryAgain)
throw Boom.unauthorized('Failed to verify user\'s '
+ 'identity.', err);
return getVerifiedProfile(argv);
});
});
.then(function () {
return argv.force
? true
: Promptly.confirmAsync('Do you want to remove all secrets and '
+ 'profile information?? [yN]', {
'default': false,
})
.then(function (force) {
if (!force)
throw Boom.conflict('User chose not to nuke '
+ 'all profiles.');
});
})
.then(config.removeAllProfiles.bind(config))