@@ -11,6 +11,7 @@ const path = process.cwd();
11
11
import chalk from 'chalk' ;
12
12
import * as qs from '../utils/questions.js' ;
13
13
import { links } from '../utils/links.js' ;
14
+ import { frontEndInstall } from '../utils/fGitHandler.js' ;
14
15
15
16
console . log ( chalk . green ( "Hello, I'm a CLI for creating a new project" ) ) ;
16
17
inquirer
@@ -70,30 +71,8 @@ inquirer
70
71
console . log ( chalk . red ( '🚧 This feature is not available yet' ) ) ;
71
72
}
72
73
inquirer . prompt ( qs . questionsRestApiF ) . then ( ( answers ) => {
73
-
74
- if ( answers [ 'frontend' ] === 'VueJs' ) {
75
- frontEndInstall ( answers , 'VueJs' ) ;
76
- // inquirer.prompt(qs.questionsRun).then((answers) => {
77
- // if (answers['Run Project']) {
78
- // shell.exec(`npm run dev`);
79
- // } else {
80
- // console.log(chalk.green('👋 Bye'));
81
- // }
82
- // });
83
- } else if ( answers [ 'frontend' ] === 'NuxtJs' ) {
84
- frontEndInstall ( answers , 'NuxtJs' ) ;
85
- } else if ( answers [ 'frontend' ] === 'Svelte' ) {
86
- frontEndInstall ( answers , 'Svelte' ) ;
87
- } else if ( answers [ 'frontend' ] === 'React' ) {
88
- frontEndInstall ( answers , 'ReactJs' ) ;
89
- } else if ( answers [ 'frontend' ] === 'NextJs' ) {
90
- frontEndInstall ( answers , 'NextJs' ) ;
91
- } else if ( answers [ 'frontend' ] === 'Angular' ) {
92
- frontEndInstall ( answers , 'Angular' ) ;
93
- }
94
- else {
95
- console . log ( chalk . red ( '🚧 Something Wrong You Should Not See This' ) ) ;
96
- }
74
+ console . log ( chalk . green ( '📁 Created a folder for the frontend project' ) ) ;
75
+ frontEndInstall ( answers [ 'frontend' ] ) ;
97
76
} ) ;
98
77
99
78
// This Part is still just idea and not implemented yet
@@ -138,18 +117,3 @@ inquirer
138
117
}
139
118
} ) ;
140
119
141
- function frontEndInstall ( answers , fmName ) {
142
- shell . exec ( `mkdir ${ answers [ 'frontend' ] } ` ) ;
143
- console . log ( chalk . green ( '📁 Created a folder for the backend project' ) ) ;
144
- console . log ( chalk . green ( 'cloning the backend project from GitHub 🚀' ) ) ;
145
- shell . exec ( `git clone ${ links . get ( fmName ) } ${ answers [ 'frontend' ] } ` ) ;
146
- shell . cd ( `${ path } /${ answers [ 'frontend' ] } ` ) ;
147
- console . log ( chalk . green ( '🚀 Installing dependencies' ) ) ;
148
- shell . exec ( `npm i` ) ;
149
- console . log ( chalk . green ( '📦 Successfully installed all the required dependencies\nHappy hacking 🚀' ) ) ;
150
- console . log ( chalk . green ( '\nMade with ❤️ by @ru44' ) ) ;
151
- shell . rm ( '-rf' , '.git' ) ;
152
- shell . rm ( '-rf' , '.github' ) ;
153
- shell . cd ( `..` ) ;
154
- }
155
-
0 commit comments