mirror of
https://github.com/balena-io/balena-cli.git
synced 2024-12-19 21:57:51 +00:00
Make use of nplugm.load
This commit is contained in:
parent
ff9558ab32
commit
ff0b513188
@ -100,21 +100,21 @@ registerPlugin = (plugin) ->
|
|||||||
return capitano.command(plugin) if not _.isArray(plugin)
|
return capitano.command(plugin) if not _.isArray(plugin)
|
||||||
return _.each(plugin, capitano.command)
|
return _.each(plugin, capitano.command)
|
||||||
|
|
||||||
try
|
nplugm.load 'resin-plugin-*', (error, plugin) ->
|
||||||
for plugin in nplugm.getPluginsByGlob('resin-plugin-*')
|
return console.error(error.message) if error?
|
||||||
registerPlugin(plugin.require())
|
registerPlugin(plugin.require())
|
||||||
catch error
|
, (error, loadedPlugins) ->
|
||||||
errors.handle(error)
|
errors.handle(error) if error?
|
||||||
|
|
||||||
cli = capitano.parse(process.argv)
|
cli = capitano.parse(process.argv)
|
||||||
|
|
||||||
changeProjectDirectory = (directory) ->
|
changeProjectDirectory = (directory) ->
|
||||||
try
|
try
|
||||||
process.chdir(directory)
|
process.chdir(directory)
|
||||||
catch
|
catch
|
||||||
errors.handle(new Error("Invalid project: #{directory}"))
|
errors.handle(new Error("Invalid project: #{directory}"))
|
||||||
|
|
||||||
resin.data.prefix.set resin.settings.get('dataPrefix'), (error) ->
|
resin.data.prefix.set resin.settings.get('dataPrefix'), (error) ->
|
||||||
errors.handle(error) if error?
|
errors.handle(error) if error?
|
||||||
|
|
||||||
if cli.global.quiet
|
if cli.global.quiet
|
||||||
|
Loading…
Reference in New Issue
Block a user