|
1 | 1 | import * as Github from '@octokit/rest';
|
2 |
| -import * as inquirer from 'inquirer'; |
| 2 | +import prompts from 'prompts'; |
3 | 3 | import { Arguments, Argv, CommandBuilder } from 'yargs';
|
4 | 4 | import chalk from 'chalk';
|
5 | 5 | import {
|
@@ -215,19 +215,15 @@ async function promptConfirmation(targetList: BaseTarget[]): Promise<void> {
|
215 | 215 | logger.info(' ');
|
216 | 216 |
|
217 | 217 | if (hasInput()) {
|
218 |
| - const questions = [ |
219 |
| - { |
220 |
| - message: 'Is everything OK? Type "yes" to proceed:', |
221 |
| - name: 'readyToPublish', |
222 |
| - type: 'input', |
223 |
| - // Force the user to type something that is not empty or one letter such |
224 |
| - // as y/n to make sure this is a concious choice. |
225 |
| - validate: (input: string) => |
226 |
| - input.length >= 2 || 'Please type "yes" to proceed', |
227 |
| - }, |
228 |
| - ]; |
229 |
| - const answers = (await inquirer.prompt(questions)) as any; |
230 |
| - const readyToPublish = coerceType<string>(answers.readyToPublish, 'string'); |
| 218 | + const { readyToPublish } = await prompts({ |
| 219 | + message: 'Is everything OK? Type "yes" to proceed:', |
| 220 | + name: 'readyToPublish', |
| 221 | + type: 'text', |
| 222 | + // Force the user to type something that is not empty or one letter such |
| 223 | + // as y/n to make sure this is a concious choice. |
| 224 | + validate: (input: string) => |
| 225 | + input.length >= 2 || 'Please type "yes" to proceed', |
| 226 | + }); |
231 | 227 | if (readyToPublish.toLowerCase() !== 'yes') {
|
232 | 228 | logger.error('Oh, okay. Aborting.');
|
233 | 229 | process.exit(1);
|
|
0 commit comments