mirror of
https://github.com/balena-io/balena-cli.git
synced 2024-12-19 05:37:51 +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.getAll();
|
||||
}).filter(function(device) {
|
||||
return device.is_online;
|
||||
}).then(function(devices) {
|
||||
if (_.isEmpty(devices)) {
|
||||
throw new Error('You don\'t have any devices');
|
||||
|
@ -155,6 +155,8 @@ exports.inferOrSelectDevice = (applicationName) ->
|
||||
if applicationName?
|
||||
return resin.models.device.getAllByApplication(applicationName)
|
||||
return resin.models.device.getAll()
|
||||
.filter (device) ->
|
||||
device.is_online
|
||||
.then (devices) ->
|
||||
if _.isEmpty(devices)
|
||||
throw new Error('You don\'t have any devices')
|
||||
|
Loading…
Reference in New Issue
Block a user