From dbedf749034471d475f05c011821c3dec94fed82 Mon Sep 17 00:00:00 2001 From: aalej Date: Tue, 28 Nov 2023 01:53:48 +0800 Subject: [PATCH] Don't prompt on non-interactive mode (#6541) * Don't prompt on non-interactive mode * Updated changelog * Updated changelog --------- Co-authored-by: joehan --- CHANGELOG.md | 1 + src/firestore/api.ts | 14 +++++++------- 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 78ecbdbea91..5ae0f507107 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,2 +1,3 @@ - Added the ability to deploy Angular apps using [the new application-builder](https://angular.dev/tools/cli/esbuild). (#6480) +- Fixed an issue where `--non-interactive` flag is not respected in Firestore indexes deploys. (#6539) - Fixed an issue where `login:use` would not work outside of a Firebase project directory. (#6526) diff --git a/src/firestore/api.ts b/src/firestore/api.ts index 002cc3f19ca..a5d2d9bd408 100644 --- a/src/firestore/api.ts +++ b/src/firestore/api.ts @@ -8,7 +8,7 @@ import * as types from "./api-types"; import * as Spec from "./api-spec"; import * as sort from "./api-sort"; import * as util from "./util"; -import { promptOnce } from "../prompt"; +import { confirm } from "../prompt"; import { firestoreOrigin } from "../api"; import { FirebaseError } from "../error"; import { Client } from "../apiv2"; @@ -89,9 +89,9 @@ export class FirestoreApi { } if (!shouldDeleteIndexes) { - shouldDeleteIndexes = await promptOnce({ - type: "confirm", - name: "confirm", + shouldDeleteIndexes = await confirm({ + nonInteractive: options.nonInteractive, + force: options.force, default: false, message: "Would you like to delete these indexes? Selecting no will continue the rest of the deployment.", @@ -135,9 +135,9 @@ export class FirestoreApi { } if (!shouldDeleteFields) { - shouldDeleteFields = await promptOnce({ - type: "confirm", - name: "confirm", + shouldDeleteFields = await confirm({ + nonInteractive: options.nonInteractive, + force: options.force, default: false, message: "Would you like to delete these field overrides? Selecting no will continue the rest of the deployment.",