mirror of
https://github.com/balena-io/balena-cli.git
synced 2024-12-23 23:42:24 +00:00
Merge pull request #364 from resin-io/feature/sync-filter-offline-devices
resin sync: filter out offline devices in interactive choosing dialog
This commit is contained in:
commit
b4c89e812c
@ -197,6 +197,8 @@ limitations under the License.
|
|||||||
return resin.models.device.getAllByApplication(applicationName);
|
return resin.models.device.getAllByApplication(applicationName);
|
||||||
}
|
}
|
||||||
return resin.models.device.getAll();
|
return resin.models.device.getAll();
|
||||||
|
}).filter(function(device) {
|
||||||
|
return device.is_online;
|
||||||
}).then(function(devices) {
|
}).then(function(devices) {
|
||||||
if (_.isEmpty(devices)) {
|
if (_.isEmpty(devices)) {
|
||||||
throw new Error('You don\'t have any devices');
|
throw new Error('You don\'t have any devices');
|
||||||
|
@ -155,6 +155,8 @@ exports.inferOrSelectDevice = (applicationName) ->
|
|||||||
if applicationName?
|
if applicationName?
|
||||||
return resin.models.device.getAllByApplication(applicationName)
|
return resin.models.device.getAllByApplication(applicationName)
|
||||||
return resin.models.device.getAll()
|
return resin.models.device.getAll()
|
||||||
|
.filter (device) ->
|
||||||
|
device.is_online
|
||||||
.then (devices) ->
|
.then (devices) ->
|
||||||
if _.isEmpty(devices)
|
if _.isEmpty(devices)
|
||||||
throw new Error('You don\'t have any devices')
|
throw new Error('You don\'t have any devices')
|
||||||
|
Loading…
Reference in New Issue
Block a user