mirror of
https://github.com/cheveguerra/bot-whatsapp.git
synced 2026-04-19 12:09:15 +00:00
monorepo/cli
This commit is contained in:
4
packages/cli/TODO.md
Normal file
4
packages/cli/TODO.md
Normal file
@@ -0,0 +1,4 @@
|
||||
- [X] Revisar version de NODE
|
||||
- [X] Revisar OS
|
||||
- Obtener Package Manager
|
||||
- Revisar las libreria de WhatsappWeb para obtener version reciente
|
||||
34
packages/cli/check.js
Normal file
34
packages/cli/check.js
Normal file
@@ -0,0 +1,34 @@
|
||||
const {red, yellow} = require('kleur')
|
||||
|
||||
const checkNodeVersion = () => {
|
||||
const version = process.version;
|
||||
const majorVersion = parseInt(version.replace('v','').split('.').shift())
|
||||
if(majorVersion < 16){
|
||||
console.error(
|
||||
red(`🔴 Se require Node.js 16 o superior. Actualmente esta ejecutando Node.js ${version}`)
|
||||
)
|
||||
process.exit(1)
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
const checkOs = () => {
|
||||
const os = process.platform
|
||||
if(!os.includes('win32')){
|
||||
const messages = [
|
||||
`El sistema operativo actual (${os}) posiblemente requiera`,
|
||||
`una confiuración adicional referente al puppeter`,
|
||||
``,
|
||||
`Recuerda pasar por el WIKI`,
|
||||
`🔗 https://github.com/leifermendez/bot-whatsapp/wiki/Instalaci%C3%B3n`,
|
||||
``
|
||||
]
|
||||
|
||||
console.log(
|
||||
yellow(messages.join(' \n'))
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
module.exports ={ checkNodeVersion, checkOs }
|
||||
0
packages/cli/index.js
Normal file
0
packages/cli/index.js
Normal file
15
packages/cli/package.json
Normal file
15
packages/cli/package.json
Normal file
@@ -0,0 +1,15 @@
|
||||
{
|
||||
"name": "cli",
|
||||
"version": "1.0.0",
|
||||
"description": "",
|
||||
"main": "index.js",
|
||||
"scripts": {
|
||||
"test": "echo \"Error: no test specified\" && exit 1"
|
||||
},
|
||||
"keywords": [],
|
||||
"author": "",
|
||||
"license": "ISC",
|
||||
"devDependencies": {
|
||||
"kleur": "^4.1.5"
|
||||
}
|
||||
}
|
||||
0
packages/cli/tool.js
Normal file
0
packages/cli/tool.js
Normal file
Reference in New Issue
Block a user