@@ -17,23 +17,20 @@ export const init = async (_options: OptionValues, command: BaseCommand) => {
17
17
18
18
const initialOpts = command . opts ( )
19
19
20
- type Answers = {
21
- drizzle : boolean
22
- installExtension : boolean
23
- }
24
-
25
20
const opts = command . opts < {
26
21
drizzle ?: boolean | undefined
27
- /**
28
- * Skip prompts and use default values (answer yes to all prompts)
29
- */
30
- yes ?: true | undefined
22
+ overwrite ?: boolean | undefined
23
+ minimal ?: boolean | undefined
31
24
} > ( )
32
25
33
26
if ( ! command . netlify . api . accessToken || ! siteInfo . account_id || ! siteInfo . name ) {
34
27
throw new Error ( `Please login with netlify login before running this command` )
35
28
}
36
29
30
+ if ( opts . minimal === true ) {
31
+ command . setOptionValue ( 'drizzle' , false )
32
+ }
33
+
37
34
const account = await getAccount ( command , { accountId : siteInfo . account_id } )
38
35
39
36
const netlifyToken = command . netlify . api . accessToken . replace ( 'Bearer ' , '' )
@@ -63,28 +60,17 @@ export const init = async (_options: OptionValues, command: BaseCommand) => {
63
60
log ( `Extension "${ extension . name } " successfully installed on team "${ account . name } "` )
64
61
}
65
62
66
- if ( ! extension . installedOnTeam && ! opts . yes ) {
67
- const answers = await inquirer . prompt < Answers > ( [
68
- {
69
- type : 'confirm' ,
70
- name : 'installExtension' ,
71
- message : `The required extension "${ extension . name } " is not installed on team "${ account . name } ", would you like to install it now?` ,
72
- } ,
73
- ] )
74
- if ( answers . installExtension ) {
75
- await installNeonExtension ( )
76
- } else {
77
- return
78
- }
79
- }
80
- if ( ! extension . installedOnTeam && opts . yes ) {
63
+ if ( ! extension . installedOnTeam ) {
81
64
await installNeonExtension ( )
82
65
}
66
+
83
67
/**
84
68
* Only prompt for drizzle if the user did not pass in the `--drizzle` or `--no-drizzle` option
85
69
*/
86
- if ( initialOpts . drizzle !== false && initialOpts . drizzle !== true && ! initialOpts . yes ) {
87
- const answers = await inquirer . prompt < Answers > ( [
70
+ if ( initialOpts . drizzle !== false && initialOpts . drizzle !== true ) {
71
+ const answers = await inquirer . prompt < {
72
+ drizzle : boolean
73
+ } > ( [
88
74
{
89
75
type : 'confirm' ,
90
76
name : 'drizzle' ,
@@ -93,8 +79,7 @@ export const init = async (_options: OptionValues, command: BaseCommand) => {
93
79
] )
94
80
command . setOptionValue ( 'drizzle' , answers . drizzle )
95
81
}
96
-
97
- if ( opts . drizzle || ( opts . yes && opts . drizzle !== false ) ) {
82
+ if ( opts . drizzle ) {
98
83
log ( `Initializing drizzle...` )
99
84
await initDrizzle ( command )
100
85
}
0 commit comments