File tree 3 files changed +20
-10
lines changed
packages/create-react-native-library/src
3 files changed +20
-10
lines changed Original file line number Diff line number Diff line change @@ -54,7 +54,7 @@ export async function printNextSteps(
54
54
) } to link the library\n`
55
55
: `- Link the library at ${ kleur . blue (
56
56
path . relative ( process . cwd ( ) , folder )
57
- ) } based on your project setup' \n`) +
57
+ ) } based on your project setup\n`) +
58
58
`- Run ${ kleur . blue (
59
59
'pod install --project-directory=ios'
60
60
) } to install dependencies with CocoaPods\n` +
Original file line number Diff line number Diff line change @@ -282,14 +282,20 @@ export async function createQuestions({
282
282
} ) ;
283
283
} ,
284
284
} ,
285
- ] ;
286
-
287
- if ( ! local ) {
288
- questions . push ( {
285
+ {
289
286
type : 'select' ,
290
287
name : 'example' ,
291
288
message : 'What type of example app do you want to create?' ,
292
289
choices : ( _ , values ) => {
290
+ if ( local ) {
291
+ return [
292
+ {
293
+ title : 'None' ,
294
+ value : 'none' ,
295
+ } ,
296
+ ] ;
297
+ }
298
+
293
299
return EXAMPLE_CHOICES . filter ( ( choice ) => {
294
300
if ( values . type ) {
295
301
return values . type === 'library'
@@ -300,8 +306,8 @@ export async function createQuestions({
300
306
return true ;
301
307
} ) ;
302
308
} ,
303
- } ) ;
304
- }
309
+ } ,
310
+ ] ;
305
311
306
312
return questions ;
307
313
}
Original file line number Diff line number Diff line change @@ -42,8 +42,14 @@ export async function prompt<T extends string>(
42
42
continue ;
43
43
}
44
44
45
+ const { type, choices } = question ;
46
+
45
47
// Don't prompt questions with a single choice
46
- if ( Array . isArray ( question . choices ) && question . choices . length === 1 ) {
48
+ if (
49
+ type === 'select' &&
50
+ Array . isArray ( question . choices ) &&
51
+ question . choices . length === 1
52
+ ) {
47
53
const onlyChoice = question . choices [ 0 ] ;
48
54
49
55
if ( onlyChoice ?. value ) {
@@ -54,8 +60,6 @@ export async function prompt<T extends string>(
54
60
continue ;
55
61
}
56
62
57
- const { type, choices } = question ;
58
-
59
63
// Don't prompt dynamic questions with a single choice
60
64
if ( type === 'select' && typeof choices === 'function' ) {
61
65
question . type = ( prev , values ) => {
You can’t perform that action at this time.
0 commit comments