mirror of
https://github.com/balena-io/balena-cli.git
synced 2025-01-31 08:25:36 +00:00
Move changeProjectDirectory outside the nested code
This commit is contained in:
parent
ff0b513188
commit
4103a4195a
@ -100,6 +100,12 @@ registerPlugin = (plugin) ->
|
||||
return capitano.command(plugin) if not _.isArray(plugin)
|
||||
return _.each(plugin, capitano.command)
|
||||
|
||||
changeProjectDirectory = (directory) ->
|
||||
try
|
||||
process.chdir(directory)
|
||||
catch
|
||||
errors.handle(new Error("Invalid project: #{directory}"))
|
||||
|
||||
nplugm.load 'resin-plugin-*', (error, plugin) ->
|
||||
return console.error(error.message) if error?
|
||||
registerPlugin(plugin.require())
|
||||
@ -108,12 +114,6 @@ nplugm.load 'resin-plugin-*', (error, plugin) ->
|
||||
|
||||
cli = capitano.parse(process.argv)
|
||||
|
||||
changeProjectDirectory = (directory) ->
|
||||
try
|
||||
process.chdir(directory)
|
||||
catch
|
||||
errors.handle(new Error("Invalid project: #{directory}"))
|
||||
|
||||
resin.data.prefix.set resin.settings.get('dataPrefix'), (error) ->
|
||||
errors.handle(error) if error?
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user