@@ -7,19 +7,23 @@ const deleteFile = filename => {
7
7
} catch ( error ) { }
8
8
}
9
9
10
- console . log ( '🔁 Applying custom scripts...' ) ;
10
+ const packagePath = path . join ( __dirname , 'package.json' ) ;
11
+ const packageJSON = JSON . parse ( fs . readFileSync ( packagePath , 'utf8' ) ) ;
11
12
12
- // Inject scripts in package.json
13
+ console . log ( '📝 Extending package.json...' ) ;
14
+
15
+ // Inject config in package.json
13
16
const 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 ) ) ;
17
20
18
21
// Remove files
19
22
deleteFile ( 'LICENSE' ) ;
20
23
deleteFile ( 'README.md' ) ;
21
24
deleteFile ( 'devDependencies.json' ) ;
25
+ deleteFile ( 'package-extension.json' ) ;
22
26
deleteFile ( 'scripts.json' ) ;
23
27
deleteFile ( 'rn-cli.config.js' ) ;
24
28
25
- console . log ( `🆗 Finished.` ) ;
29
+ console . log ( `✅ Finished.` ) ;
0 commit comments