mirror of
https://github.com/balena-io/balena-cli.git
synced 2025-02-07 11:31:15 +00:00
Merge pull request #1136 from balena-io/ssh-no-suggest
ssh: add flag not to suggest devices to connect to
This commit is contained in:
commit
a4dd45e6a6
@ -975,6 +975,7 @@ Examples:
|
|||||||
$ balena ssh 7cf02a6 --port 8080
|
$ balena ssh 7cf02a6 --port 8080
|
||||||
$ balena ssh 7cf02a6 -v
|
$ balena ssh 7cf02a6 -v
|
||||||
$ balena ssh 7cf02a6 -s
|
$ balena ssh 7cf02a6 -s
|
||||||
|
$ balena ssh 7cf02a6 --noninteractive
|
||||||
|
|
||||||
### Options
|
### Options
|
||||||
|
|
||||||
@ -994,6 +995,10 @@ access host OS (for devices with balenaOS >= 2.0.0+rev1)
|
|||||||
|
|
||||||
don't use the proxy configuration for this connection. Only makes sense if you've configured proxy globally.
|
don't use the proxy configuration for this connection. Only makes sense if you've configured proxy globally.
|
||||||
|
|
||||||
|
#### --noninteractive
|
||||||
|
|
||||||
|
run command non-interactively, do not automatically suggest devices to connect to if UUID not found
|
||||||
|
|
||||||
# Notes
|
# Notes
|
||||||
|
|
||||||
## note <|note>
|
## note <|note>
|
||||||
|
@ -35,6 +35,7 @@ module.exports =
|
|||||||
$ balena ssh 7cf02a6 --port 8080
|
$ balena ssh 7cf02a6 --port 8080
|
||||||
$ balena ssh 7cf02a6 -v
|
$ balena ssh 7cf02a6 -v
|
||||||
$ balena ssh 7cf02a6 -s
|
$ balena ssh 7cf02a6 -s
|
||||||
|
$ balena ssh 7cf02a6 --noninteractive
|
||||||
'''
|
'''
|
||||||
permission: 'user'
|
permission: 'user'
|
||||||
primary: true
|
primary: true
|
||||||
@ -53,6 +54,10 @@ module.exports =
|
|||||||
boolean: true
|
boolean: true
|
||||||
description: "don't use the proxy configuration for this connection.
|
description: "don't use the proxy configuration for this connection.
|
||||||
Only makes sense if you've configured proxy globally."
|
Only makes sense if you've configured proxy globally."
|
||||||
|
,
|
||||||
|
signature: 'noninteractive'
|
||||||
|
boolean: true
|
||||||
|
description: 'run command non-interactively, do not automatically suggest devices to connect to if UUID not found'
|
||||||
]
|
]
|
||||||
action: (params, options, done) ->
|
action: (params, options, done) ->
|
||||||
normalizeUuidProp(params)
|
normalizeUuidProp(params)
|
||||||
@ -103,6 +108,9 @@ module.exports =
|
|||||||
return balena.models.device.has(params.uuid)
|
return balena.models.device.has(params.uuid)
|
||||||
.then (uuidExists) ->
|
.then (uuidExists) ->
|
||||||
return params.uuid if uuidExists
|
return params.uuid if uuidExists
|
||||||
|
if options.noninteractive
|
||||||
|
console.error("Could not find device: #{params.uuid}")
|
||||||
|
process.exit(1)
|
||||||
return patterns.inferOrSelectDevice()
|
return patterns.inferOrSelectDevice()
|
||||||
.then (uuid) ->
|
.then (uuid) ->
|
||||||
console.info("Connecting to: #{uuid}")
|
console.info("Connecting to: #{uuid}")
|
||||||
|
Loading…
x
Reference in New Issue
Block a user