@@ -32,6 +32,7 @@ import { eventCliSession, telemetry } from '../../events/index.js';
32
32
import { exec } from '../exec.js' ;
33
33
import { type Flags , createLoggerFromFlags , flagsToAstroInlineConfig } from '../flags.js' ;
34
34
import { fetchPackageJson , fetchPackageVersions } from '../install-package.js' ;
35
+ import type yargsParser from 'yargs-parser' ;
35
36
36
37
interface AddOptions {
37
38
flags : Flags ;
@@ -138,7 +139,7 @@ export async function add(names: string[], { flags }: AddOptions) {
138
139
const cwd = inlineConfig . root ;
139
140
const logger = createLoggerFromFlags ( flags ) ;
140
141
const integrationNames = names . map ( ( name ) => ( ALIASES . has ( name ) ? ALIASES . get ( name ) ! : name ) ) ;
141
- const integrations = await validateIntegrations ( integrationNames ) ;
142
+ const integrations = await validateIntegrations ( integrationNames , flags ) ;
142
143
let installResult = await tryToInstallIntegrations ( { integrations, cwd, flags, logger } ) ;
143
144
const rootPath = resolveRoot ( cwd ) ;
144
145
const root = pathToFileURL ( rootPath ) ;
@@ -713,7 +714,10 @@ async function tryToInstallIntegrations({
713
714
}
714
715
}
715
716
716
- async function validateIntegrations ( integrations : string [ ] ) : Promise < IntegrationInfo [ ] > {
717
+ async function validateIntegrations (
718
+ integrations : string [ ] ,
719
+ flags : yargsParser . Arguments ,
720
+ ) : Promise < IntegrationInfo [ ] > {
717
721
const spinner = yoctoSpinner ( { text : 'Resolving packages...' } ) . start ( ) ;
718
722
try {
719
723
const integrationEntries = await Promise . all (
@@ -735,13 +739,7 @@ async function validateIntegrations(integrations: string[]): Promise<Integration
735
739
spinner . warning ( yellow ( firstPartyPkgCheck . message ) ) ;
736
740
}
737
741
spinner . warning ( yellow ( `${ bold ( integration ) } is not an official Astro package.` ) ) ;
738
- const response = await prompts ( {
739
- type : 'confirm' ,
740
- name : 'askToContinue' ,
741
- message : 'Continue?' ,
742
- initial : true ,
743
- } ) ;
744
- if ( ! response . askToContinue ) {
742
+ if ( ! ( await askToContinue ( { flags } ) ) ) {
745
743
throw new Error (
746
744
`No problem! Find our official integrations at ${ cyan (
747
745
'https://astro.build/integrations' ,
0 commit comments