File tree Expand file tree Collapse file tree 2 files changed +24
-17
lines changed
packages/create-react-native-library/src Expand file tree Collapse file tree 2 files changed +24
-17
lines changed Original file line number Diff line number Diff line change @@ -18,7 +18,7 @@ import {
18
18
type Args ,
19
19
} from './input' ;
20
20
import { getDependencyVersionsFromExample } from './exampleApp/dependencies' ;
21
- import { printErrorHelp , printNextSteps } from './inform' ;
21
+ import { printErrorHelp , printNextSteps , printUsedRNVersion } from './inform' ;
22
22
23
23
const FALLBACK_BOB_VERSION = '0.32.0' ;
24
24
@@ -82,22 +82,8 @@ async function create(_argv: yargs.Arguments<Args>) {
82
82
83
83
await fs . mkdirp ( folder ) ;
84
84
85
- if ( answers . reactNativeVersion != null ) {
86
- if ( config . example === 'vanilla' ) {
87
- console . log (
88
- `${ kleur . blue ( 'ℹ' ) } Using ${ kleur . cyan (
89
- `react-native@${ answers . reactNativeVersion } `
90
- ) } for the example`
91
- ) ;
92
- } else {
93
- console . warn (
94
- `${ kleur . yellow (
95
- '⚠'
96
- ) } Ignoring --react-native-version for unsupported example type: ${ kleur . cyan (
97
- config . example
98
- ) } `
99
- ) ;
100
- }
85
+ if ( answers . reactNativeVersion !== null ) {
86
+ printUsedRNVersion ( answers . reactNativeVersion , config ) ;
101
87
}
102
88
103
89
const spinner = ora ( ) . start ( ) ;
Original file line number Diff line number Diff line change @@ -122,3 +122,24 @@ export function printErrorHelp(message: string, error: Error) {
122
122
123
123
process . exit ( 1 ) ;
124
124
}
125
+
126
+ export function printUsedRNVersion (
127
+ version : string ,
128
+ config : TemplateConfiguration
129
+ ) {
130
+ if ( config . example === 'vanilla' ) {
131
+ console . log (
132
+ `${ kleur . blue ( 'ℹ' ) } Using ${ kleur . cyan (
133
+ `react-native@${ version } `
134
+ ) } for the example`
135
+ ) ;
136
+ } else {
137
+ console . warn (
138
+ `${ kleur . yellow (
139
+ '⚠'
140
+ ) } Ignoring --react-native-version for unsupported example type: ${ kleur . cyan (
141
+ config . example
142
+ ) } `
143
+ ) ;
144
+ }
145
+ }
You can’t perform that action at this time.
0 commit comments