File tree Expand file tree Collapse file tree 2 files changed +11
-23
lines changed
packages/create-react-native-library/src Expand file tree Collapse file tree 2 files changed +11
-23
lines changed Original file line number Diff line number Diff line change @@ -416,16 +416,21 @@ async function create(argv: yargs.Arguments<any>) {
416
416
} ;
417
417
418
418
await fs . mkdirp ( folder ) ;
419
+
420
+ const spinner = ora ( 'Generating example app' ) . start ( ) ;
421
+
419
422
if ( example === 'native' ) {
420
- const spinner = ora ( 'Generating example app' ) . start ( ) ;
421
423
await generateRNApp ( {
422
424
dest : folder ,
423
425
projectName : options . project . name ,
424
426
isNewArch : options . project . turbomodule ,
425
427
} ) ;
426
- spinner . succeed ( ) ;
427
428
}
428
429
430
+ spinner . succeed (
431
+ `Project created successfully at ${ kleur . yellow ( argv . name ) } !\n`
432
+ ) ;
433
+
429
434
await copyDir ( COMMON_FILES , folder ) ;
430
435
431
436
if ( languages === 'js' ) {
@@ -517,8 +522,6 @@ async function create(argv: yargs.Arguments<any>) {
517
522
518
523
console . log (
519
524
dedent ( `
520
- Project created successfully at ${ kleur . yellow ( argv . name ) } !
521
-
522
525
${ kleur . magenta (
523
526
`${ kleur . bold ( 'Get started' ) } with the project`
524
527
) } ${ kleur . gray ( ':' ) }
Original file line number Diff line number Diff line change 1
- import fs from 'fs' ;
1
+ import fs from 'fs-extra ' ;
2
2
import spawn from 'cross-spawn' ;
3
3
import path from 'path' ;
4
4
@@ -58,24 +58,9 @@ export default async function generateRNApp({
58
58
createRNAppProcess . once ( 'close' , resolve ) ;
59
59
} ) ;
60
60
61
- // Remove unnecessary files
62
- FILES_TO_DELETE . forEach ( ( file ) => {
63
- try {
64
- fs . unlinkSync ( path . join ( dest , 'example' , file ) ) ;
65
- } catch ( e ) {
66
- //ignore
67
- }
68
- } ) ;
69
-
70
- // Remove unnecessary folders
71
- FOLDERS_TO_DELETE . forEach ( ( folder ) => {
72
- try {
73
- fs . rmSync ( path . join ( dest , 'example' , folder ) , {
74
- recursive : true ,
75
- } ) ;
76
- } catch ( e ) {
77
- // ignore
78
- }
61
+ // Remove unnecessary files and folders
62
+ [ ...FILES_TO_DELETE , ...FOLDERS_TO_DELETE ] . forEach ( ( file ) => {
63
+ fs . removeSync ( path . join ( dest , 'example' , file ) ) ;
79
64
} ) ;
80
65
81
66
// Patch the example app's package.json
You can’t perform that action at this time.
0 commit comments