@@ -7,19 +7,23 @@ const deleteFile = filename => {
77 } catch ( error ) { }
88}
99
10- console . log ( '🔁 Applying custom scripts...' ) ;
10+ const packagePath = path . join ( __dirname , 'package.json' ) ;
11+ const packageJSON = JSON . parse ( fs . readFileSync ( packagePath , 'utf8' ) ) ;
1112
12- // Inject scripts in package.json
13+ console . log ( '📝 Extending package.json...' ) ;
14+
15+ // Inject config in package.json
1316const scripts = require ( './scripts.json' ) ;
14- const packageJSON = JSON . parse ( fs . readFileSync ( path . join ( __dirname , ' package.json') , 'utf8' ) ) ;
15- const updatedPackageJSON = Object . assign ( { } , packageJSON , scripts ) ;
16- fs . writeFileSync ( path . join ( __dirname , 'package.json' ) , JSON . stringify ( updatedPackageJSON , null , 2 ) ) ;
17+ const extension = require ( './ package-extension .json') ;
18+ const updatedPackageJSON = Object . assign ( { } , packageJSON , scripts , extension ) ;
19+ fs . writeFileSync ( packagePath , JSON . stringify ( updatedPackageJSON , null , 2 ) ) ;
1720
1821// Remove files
1922deleteFile ( 'LICENSE' ) ;
2023deleteFile ( 'README.md' ) ;
2124deleteFile ( 'devDependencies.json' ) ;
25+ deleteFile ( 'package-extension.json' ) ;
2226deleteFile ( 'scripts.json' ) ;
2327deleteFile ( 'rn-cli.config.js' ) ;
2428
25- console . log ( `🆗 Finished.` ) ;
29+ console . log ( `✅ Finished.` ) ;
0 commit comments