mirror of
https://github.com/balena-io/balena-cli.git
synced 2025-02-07 11:31:15 +00:00
14 lines
382 B
CoffeeScript
14 lines
382 B
CoffeeScript
nplugm = require('nplugm')
|
|
_ = require('lodash')
|
|
capitano = require('capitano')
|
|
|
|
registerPlugin = (plugin) ->
|
|
return capitano.command(plugin) if not _.isArray(plugin)
|
|
return _.each(plugin, capitano.command)
|
|
|
|
exports.register = (glob, callback) ->
|
|
nplugm.load glob, (error, plugin) ->
|
|
return console.error(error.message) if error?
|
|
registerPlugin(plugin.require())
|
|
, callback
|