File tree Expand file tree Collapse file tree 4 files changed +30
-3
lines changed Expand file tree Collapse file tree 4 files changed +30
-3
lines changed Original file line number Diff line number Diff line change @@ -366,7 +366,7 @@ export default async function create(argv: yargs.Arguments<any>) {
366366
367367 {magenta {bold Get started} with the project}{gray :}
368368
369- {gray $} yarn bootstrap
369+ {gray $} yarn
370370 ${ Object . entries ( platforms )
371371 . map (
372372 ( [ script , { name, color } ] ) => chalk `
Original file line number Diff line number Diff line change 1+ # Override Yarn command so we can automatically setup the repo on running `yarn`
2+
3+ yarn-path "scripts/bootstrap.js"
Original file line number Diff line number Diff line change @@ -4,10 +4,10 @@ We want this community to be friendly and respectful to each other. Please follo
44
55## Development workflow
66
7- To get started with the project, run ` yarn bootstrap ` in the root directory to install the required dependencies for each package:
7+ To get started with the project, run ` yarn ` in the root directory to install the required dependencies for each package:
88
99``` sh
10- yarn bootstrap
10+ yarn
1111```
1212
1313While developing, you can run the [ example app] ( /example/ ) to test your changes.
Original file line number Diff line number Diff line change 1+ const path = require ( 'path' ) ;
2+ const child_process = require ( 'child_process' ) ;
3+
4+ const root = path . resolve ( __dirname , '..' ) ;
5+ const args = process . argv . slice ( 2 ) ;
6+ const options = {
7+ cwd : process . cwd ( ) ,
8+ env : process . env ,
9+ stdio : 'inherit' ,
10+ encoding : 'utf-8' ,
11+ } ;
12+
13+ let result ;
14+
15+ if ( process . cwd ( ) !== root || args . length ) {
16+ // We're not in the root of the project, or additional arguments were passed
17+ // In this case, forward the command to `yarn`
18+ result = child_process . spawnSync ( 'yarn' , args , options ) ;
19+ } else {
20+ // If `yarn` is run without arguments, perform bootstrap
21+ result = child_process . spawnSync ( 'yarn' , [ 'bootstrap' ] , options ) ;
22+ }
23+
24+ process . exitCode = result . status ;
You can’t perform that action at this time.
0 commit comments