mirror of
https://github.com/balena-io/balena-cli.git
synced 2025-04-08 03:44:13 +00:00
Implement "project" global option
This commit is contained in:
parent
eb34d957f3
commit
a8678f419b
@ -31,6 +31,12 @@ capitano.globalOption
|
||||
boolean: true
|
||||
alias: 'q'
|
||||
|
||||
capitano.globalOption
|
||||
signature: 'project'
|
||||
parameter: 'path'
|
||||
description: 'project path'
|
||||
alias: 'p'
|
||||
|
||||
yesOption =
|
||||
signature: 'yes'
|
||||
description: 'confirm non interactively'
|
||||
@ -479,9 +485,18 @@ capitano.command
|
||||
|
||||
cli = capitano.parse(process.argv)
|
||||
|
||||
changeProjectDirectory = (directory) ->
|
||||
try
|
||||
process.chdir(directory)
|
||||
catch
|
||||
resin.errors.handle(new Error("Invalid project: #{directory}"))
|
||||
|
||||
resin.data.prefix.set resin.settings.get('dataPrefix'), (error) ->
|
||||
resin.errors.handle(error) if error?
|
||||
|
||||
resin.log.setQuiet(cli.global.quiet)
|
||||
|
||||
if cli.global.project?
|
||||
changeProjectDirectory(cli.global.project)
|
||||
|
||||
capitano.execute(cli)
|
||||
|
Loading…
x
Reference in New Issue
Block a user