( message: string, question: string, defaultVal: boolean, options: Options, )
| 50 | }; |
| 51 | |
| 52 | async function query( |
| 53 | message: string, |
| 54 | question: string, |
| 55 | defaultVal: boolean, |
| 56 | options: Options, |
| 57 | ): Promise<boolean> { |
| 58 | if (options.yes) { |
| 59 | return true; |
| 60 | } else if (options.no) { |
| 61 | return false; |
| 62 | } |
| 63 | |
| 64 | if (message) { |
| 65 | options.logger.log(message); |
| 66 | } |
| 67 | |
| 68 | const answers: inquirer.Answers = await inquirer.prompt({ |
| 69 | type: 'confirm', |
| 70 | name: 'query', |
| 71 | message: question, |
| 72 | default: defaultVal, |
| 73 | }); |
| 74 | return answers.query; |
| 75 | } |
| 76 | |
| 77 | export async function addScripts( |
| 78 | packageJson: PackageJSON, |
no outgoing calls
no test coverage detected
searching dependent graphs…