Skip to content

Commit 61f2fee

Browse files
committed
Configured custom multi-package install
1 parent 541a702 commit 61f2fee

File tree

1 file changed

+8
-9
lines changed

1 file changed

+8
-9
lines changed

cliRoutes/CustomPackageInstall/index.js

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ const errorLogging = require('../../customNodeCMD/customError')
55
// Cli Model
66
const cliModel = require('../../cliModel')
77
const multiplePackageInstall = cliModel.multiplePackageInstall
8-
const installFolder = cliModel.installFolder
98
const YarnOrNpm = cliModel.YarnOrNpm
109

1110
const { createReactApp } = require('../../cliModel/install-commands')
@@ -30,7 +29,9 @@ module.exports = class CustomPackageInstall {
3029
switch (packageManager) {
3130
case 'Yarn':
3231
customCMD.get(
33-
`${createReactAppYarn} . && yarn add ${packages.join(' ')} `,
32+
`${createReactAppYarn} my-app && cd my-app && yarn add ${packages.join(
33+
' '
34+
)} `,
3435
(err, data, stderr) => {
3536
err ? console.log(err) : errorLogging(stderr, data)
3637
},
@@ -40,7 +41,9 @@ module.exports = class CustomPackageInstall {
4041

4142
case 'NPM':
4243
customCMD.get(
43-
`${createReactApp} && npm install --save ${packages.join(' ')}`,
44+
`${createReactApp} my-app && cd my-app && npm install --save ${packages.join(
45+
' '
46+
)}`,
4447
(err, data, stderr) => {
4548
err ? console.log(err) : errorLogging(stderr, data)
4649
},
@@ -51,7 +54,7 @@ module.exports = class CustomPackageInstall {
5154
switch (packageManager) {
5255
case 'Yarn':
5356
customCMD.get(
54-
`${createReactAppYarn} . && yarn add ${packages.join(' ')} `,
57+
`yarn add ${packages.join(' ')} `,
5558
(err, data, stderr) => {
5659
err ? console.log(err) : errorLogging(stderr, data)
5760
},
@@ -61,18 +64,14 @@ module.exports = class CustomPackageInstall {
6164

6265
case 'NPM':
6366
customCMD.get(
64-
`${createReactApp} && npm install --save ${packages.join(' ')}`,
67+
`npm install --save ${packages.join(' ')}`,
6568
(err, data, stderr) => {
6669
err ? console.log(err) : errorLogging(stderr, data)
6770
},
6871
'install'
6972
)
7073
}
7174
}
72-
console.log(packages.shift())
73-
console.log(packages.join(' '))
74-
console.log(packages.join(' '))
75-
console.log(`${packages.join(' ')}`)
7675
})
7776
})
7877
}

0 commit comments

Comments
 (0)