mirror of
https://github.com/balena-io/balena-cli.git
synced 2024-12-23 23:42:24 +00:00
97d9b7816f
Print plugin warnings in red as other errors
14 lines
399 B
CoffeeScript
14 lines
399 B
CoffeeScript
nplugm = require('nplugm')
|
|
_ = require('lodash')
|
|
capitano = require('capitano')
|
|
patterns = require('./patterns')
|
|
|
|
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) ->
|
|
patterns.printErrorMessage(error.message)
|