How to use the promptly.confirmAsync function in promptly

To help you get started, we’ve selected a few promptly examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github auth0 / wt-cli / bin / profile.js View on Github external
.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) {
github auth0 / wt-cli / bin / profile.js View on Github external
.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);
                });
        });
github auth0 / wt-cli / bin / profile.js View on Github external
.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))

promptly

Simple command line prompting utility

MIT
Latest version published 4 years ago

Package Health Score

74 / 100
Full package analysis