mirror of
https://github.com/balena-io/balena-cli.git
synced 2024-12-19 21:57:51 +00:00
ec77437080
For the sake of consistency.
13 lines
375 B
CoffeeScript
13 lines
375 B
CoffeeScript
nplugm = require('nplugm')
|
|
_ = require('lodash')
|
|
capitano = require('capitano')
|
|
patterns = require('./patterns')
|
|
|
|
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) ->
|
|
patterns.printErrorMessage(error.message)
|