mirror of
https://github.com/balena-io/balena-cli.git
synced 2024-12-20 06:07:55 +00:00
f8470287c1
Only list primary commands by default, unless a `--verbose` option is passed to list the additional ones. Fixes: https://github.com/resin-io/resin-cli/issues/101
13 lines
353 B
CoffeeScript
13 lines
353 B
CoffeeScript
nplugm = require('nplugm')
|
|
_ = require('lodash')
|
|
capitano = require('capitano')
|
|
|
|
exports.register = (regex) ->
|
|
nplugm.list(regex).map (plugin) ->
|
|
command = require(plugin)
|
|
command.plugin = true
|
|
return capitano.command(command) if not _.isArray(command)
|
|
return _.each(command, capitano.command)
|
|
.catch (error) ->
|
|
console.error(error.message)
|