File tree Expand file tree Collapse file tree 2 files changed +20
-3
lines changed
packages/create-react-dependency Expand file tree Collapse file tree 2 files changed +20
-3
lines changed Original file line number Diff line number Diff line change @@ -33,8 +33,7 @@ if (typeof projectName === "undefined") {
3333 fs . mkdirSync ( projectName ) ;
3434
3535 createPackageJson ( root , projectName ) ;
36- await installTemplate ( root ) ;
37-
38- // installDependencies(root, type, verbose);
36+ await createTemplate ( root ) ;
37+ installDependencies ( root , type , verbose ) ;
3938 // initializeGit(name, verbose);
4039}
Original file line number Diff line number Diff line change 1+ "use strict" ;
2+
3+ const { execSync } = require ( "child_process" ) ;
4+
5+ const installDependencies = dir => {
6+ const originalDirectory = process . cwd ( ) ;
7+ try {
8+ process . chdir ( dir ) ;
9+
10+ execSync ( "yarnpkg install" , { stdio : "inherit" } ) ;
11+ } catch ( err ) {
12+ console . log ( `\x1b[31m${ err } \x1b[0m` ) ;
13+ }
14+
15+ process . chdir ( originalDirectory ) ;
16+ } ;
17+
18+ module . exports = installDependencies ;
You can’t perform that action at this time.
0 commit comments