11#!/usr/bin/env node
2+ import { copyFileSync , renameSync , rmSync } from 'fs'
23import { join } from 'path'
34import { execSync } from 'child_process'
4- import copy from 'recursive-copy'
5- import rimraf from 'rimraf'
65
7- // Enhances source files inside /app with a fresh RN project template.
6+ // This script enhances source files inside /app with a fresh React Native template.
87const appName = '<%= pascal %>App'
98
109console . log ( '⌛ Initializing a fresh RN project...' )
@@ -14,15 +13,11 @@ execSync(`npx react-native init ${appName}`, {
1413 stdio : 'inherit' ,
1514} )
1615
17- // Copy to destination directory, leaving source files untouched.
18- await copy ( appName , 'app' , {
19- dot : true ,
20- overwrite : false ,
21- filter : [ '**/*' , '!App.js' ] ,
22- } )
16+ copyFileSync ( 'app/App.js' , `${ appName } /App.js` )
17+
18+ rmSync ( 'app' , { recursive : true } )
2319
24- // Remove temporary project directory.
25- rimraf . sync ( appName )
20+ renameSync ( appName , 'app' )
2621
2722// Install this package locally, avoiding symlinks.
2823execSync ( 'npm install $(npm pack .. | tail -1) --legacy-peer-deps' , {
0 commit comments