From aa3520eb7d7bba15b65df04800037c4149c9f45d Mon Sep 17 00:00:00 2001 From: Joey Perrott Date: Tue, 11 Aug 2020 15:29:11 -0700 Subject: [PATCH] refactor(dev-infra): use promptConfirm util in ng-dev's formatter (#38419) Use the promptConfirm util instead of manually creating a confirm prompt with inquirer. PR Close #38419 --- dev-infra/format/BUILD.bazel | 2 -- dev-infra/format/format.ts | 10 ++-------- 2 files changed, 2 insertions(+), 10 deletions(-) diff --git a/dev-infra/format/BUILD.bazel b/dev-infra/format/BUILD.bazel index 2b340e6aeb..73f836bc5f 100644 --- a/dev-infra/format/BUILD.bazel +++ b/dev-infra/format/BUILD.bazel @@ -10,12 +10,10 @@ ts_library( deps = [ "//dev-infra/utils", "@npm//@types/cli-progress", - "@npm//@types/inquirer", "@npm//@types/node", "@npm//@types/shelljs", "@npm//@types/yargs", "@npm//cli-progress", - "@npm//inquirer", "@npm//multimatch", "@npm//shelljs", "@npm//yargs", diff --git a/dev-infra/format/format.ts b/dev-infra/format/format.ts index b7c55fbf9c..e3e79f6a40 100644 --- a/dev-infra/format/format.ts +++ b/dev-infra/format/format.ts @@ -6,9 +6,7 @@ * found in the LICENSE file at https://angular.io/license */ -import {prompt} from 'inquirer'; - -import {error, info} from '../utils/console'; +import {error, info, promptConfirm} from '../utils/console'; import {runFormatterInParallel} from './run-commands-parallel'; @@ -57,11 +55,7 @@ export async function checkFiles(files: string[]) { // If the command is run in a non-CI environment, prompt to format the files immediately. let runFormatter = false; if (!process.env['CI']) { - runFormatter = (await prompt({ - type: 'confirm', - name: 'runFormatter', - message: 'Format the files now?', - })).runFormatter; + runFormatter = await promptConfirm('Format the files now?', true); } if (runFormatter) {