mirror of
https://github.com/EvolutionAPI/evolution-manager.git
synced 2025-12-19 11:32:18 -06:00
add path api to CLI
This commit is contained in:
16
lib/api/index.js
Normal file
16
lib/api/index.js
Normal file
@@ -0,0 +1,16 @@
|
||||
const functions = {
|
||||
setup: require('./setup.js'),
|
||||
}
|
||||
|
||||
module.exports = async (argv) => {
|
||||
try {
|
||||
if (argv._.length === 1) throw new Error('No operation specified')
|
||||
const operation = argv._[1]
|
||||
if (!functions[operation]) throw new Error(`Unknown operation: ${operation}`)
|
||||
|
||||
await functions[operation](argv)
|
||||
} catch (e) {
|
||||
console.error(e.message || e)
|
||||
process.exit(1)
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user