mirror of
https://github.com/balena-io/balena-cli.git
synced 2024-12-20 14:13:07 +00:00
12 lines
329 B
CoffeeScript
12 lines
329 B
CoffeeScript
|
nplugm = require('nplugm')
|
||
|
_ = require('lodash')
|
||
|
capitano = require('capitano')
|
||
|
|
||
|
exports.register = (regex) ->
|
||
|
nplugm.list(regex).map (plugin) ->
|
||
|
command = require(plugin)
|
||
|
return capitano.command(command) if not _.isArray(command)
|
||
|
return _.each(command, capitano.command)
|
||
|
.catch (error) ->
|
||
|
console.error(error.message)
|