|
1 | 1 | /* eslint-disable @typescript-eslint/explicit-function-return-type */ |
2 | | -const { prompt } = require('inquirer'); |
3 | | -const chalk = require('chalk'); |
4 | | -const logger = require('../utils/logger'); |
| 2 | +// const { prompt } = require('inquirer'); |
| 3 | +// const chalk = require('chalk'); |
| 4 | +// const logger = require('../utils/logger'); |
5 | 5 |
|
6 | 6 | class ExternalCommand { |
7 | 7 | static async runCommand(command, args = []) { |
@@ -31,32 +31,33 @@ class ExternalCommand { |
31 | 31 | return false; |
32 | 32 | } |
33 | 33 | } |
34 | | - static async promptInstallation(scopeName, name) { |
35 | | - const path = require('path'); |
36 | | - const fs = require('fs'); |
37 | | - const isYarn = fs.existsSync(path.resolve(process.cwd(), 'yarn.lock')); |
38 | | - const packageManager = isYarn ? 'yarn' : 'npm'; |
39 | | - const options = [isYarn ? 'add' : 'install', '-D', scopeName]; |
40 | | - |
41 | | - const commandToBeRun = `${packageManager} ${options.join(' ')}`; |
42 | | - logger.error(`The command moved into a separate package: ${chalk.keyword('orange')(name)}\n`); |
43 | | - const question = `Would you like to install ${name}? (That will run ${chalk.green(commandToBeRun)})`; |
44 | | - const { installConfirm } = await prompt([ |
45 | | - { |
46 | | - type: 'confirm', |
47 | | - name: 'installConfirm', |
48 | | - message: question, |
49 | | - default: 'Y', |
50 | | - choices: ['Yes', 'No', 'Y', 'N', 'y', 'n'], |
51 | | - }, |
52 | | - ]); |
53 | | - if (installConfirm === true) { |
54 | | - await ExternalCommand.runCommand(commandToBeRun); |
55 | | - return ExternalCommand.validateEnv(name); |
56 | | - } |
57 | | - // eslint-disable-next-line require-atomic-updates |
58 | | - process.exitCode = -1; |
59 | | - } |
| 34 | + // TODO: to implement once "inquirer" will be avialable inside the CI |
| 35 | + // static async promptInstallation(scopeName, name) { |
| 36 | + // const path = require('path'); |
| 37 | + // const fs = require('fs'); |
| 38 | + // const isYarn = fs.existsSync(path.resolve(process.cwd(), 'yarn.lock')); |
| 39 | + // const packageManager = isYarn ? 'yarn' : 'npm'; |
| 40 | + // const options = [isYarn ? 'add' : 'install', '-D', scopeName]; |
| 41 | + // |
| 42 | + // const commandToBeRun = `${packageManager} ${options.join(' ')}`; |
| 43 | + // logger.error(`The command moved into a separate package: ${chalk.keyword('orange')(name)}\n`); |
| 44 | + // const question = `Would you like to install ${name}? (That will run ${chalk.green(commandToBeRun)})`; |
| 45 | + // const { installConfirm } = await prompt([ |
| 46 | + // { |
| 47 | + // type: 'confirm', |
| 48 | + // name: 'installConfirm', |
| 49 | + // message: question, |
| 50 | + // default: 'Y', |
| 51 | + // choices: ['Yes', 'No', 'Y', 'N', 'y', 'n'], |
| 52 | + // }, |
| 53 | + // ]); |
| 54 | + // if (installConfirm === true) { |
| 55 | + // await ExternalCommand.runCommand(commandToBeRun); |
| 56 | + // return ExternalCommand.validateEnv(name); |
| 57 | + // } |
| 58 | + // // eslint-disable-next-line require-atomic-updates |
| 59 | + // process.exitCode = -1; |
| 60 | + // } |
60 | 61 |
|
61 | 62 | static async run(name, ...args) { |
62 | 63 | let pkgLoc = ExternalCommand.validateEnv(name); |
|
0 commit comments