mirror of
https://github.com/balena-io/balena-cli.git
synced 2025-01-31 08:25:36 +00:00
Merge pull request #1242 from balena-io/1241-apps-length-undefined
Fix TypeError when running 'balena apps'
This commit is contained in:
commit
8c60c9e076
@ -82,6 +82,7 @@ exports.list =
|
||||
permission: 'user'
|
||||
primary: true
|
||||
action: (params, options, done) ->
|
||||
_ = require('lodash')
|
||||
balena = require('balena-sdk').fromSharedOptions()
|
||||
visuals = require('resin-cli-visuals')
|
||||
|
||||
@ -94,8 +95,8 @@ exports.list =
|
||||
$expand: owns__device: $select: 'is_online'
|
||||
.then (applications) ->
|
||||
applications.forEach (application) ->
|
||||
application.device_count = application.owns__device.length
|
||||
application.online_devices = application.owns__device.filter((d) -> d.is_online == true).length
|
||||
application.device_count = _.size(application.owns__device)
|
||||
application.online_devices = _.filter(application.owns__device, (d) -> d.is_online == true).length
|
||||
|
||||
console.log visuals.table.horizontal applications, [
|
||||
'id'
|
||||
|
Loading…
x
Reference in New Issue
Block a user