File tree Expand file tree Collapse file tree 2 files changed +9
-5
lines changed Expand file tree Collapse file tree 2 files changed +9
-5
lines changed Original file line number Diff line number Diff line change @@ -110,11 +110,14 @@ export function mergeConfig(lhs, rhs) {
110
110
111
111
/**
112
112
* Returns whether `react-native.config.js` needs to be updated.
113
- * @param {string } packagePath
113
+ * @param {string } configPath
114
114
* @returns {boolean }
115
115
*/
116
- function shouldUpdateReactNativeConfig ( packagePath , fs = nodefs ) {
117
- const configPath = path . join ( packagePath , "react-native.config.js" ) ;
116
+ function shouldUpdateReactNativeConfig ( configPath , fs = nodefs ) {
117
+ if ( ! fs . existsSync ( configPath ) ) {
118
+ return true ;
119
+ }
120
+
118
121
const config = readTextFile ( configPath , fs ) ;
119
122
return (
120
123
! / [ " ' ` ] r e a c t - n a t i v e - t e s t - a p p [ " ' ` ] / . test ( config ) ||
@@ -681,7 +684,8 @@ export function configure(params, fs = nodefs) {
681
684
const templateFiles = Object . entries ( files ) . filter ( ( [ filename ] ) => {
682
685
switch ( filename ) {
683
686
case "react-native.config.js" : {
684
- const needsUpdate = shouldUpdateReactNativeConfig ( packagePath ) ;
687
+ const configPath = path . join ( packagePath , filename ) ;
688
+ const needsUpdate = shouldUpdateReactNativeConfig ( configPath ) ;
685
689
if ( ! needsUpdate ) {
686
690
warn (
687
691
`skipped modifying '${ filename } ' because it may already be configured for 'react-native-test-app'`
Original file line number Diff line number Diff line change @@ -73,7 +73,7 @@ async function makeProject(
73
73
init : true ,
74
74
} ) ;
75
75
76
- await writeAllFiles ( files , packagePath ) ;
76
+ await writeAllFiles ( Object . entries ( files ) , packagePath ) ;
77
77
78
78
try {
79
79
await fsp . symlink (
You can’t perform that action at this time.
0 commit comments