mirror of
https://github.com/balena-io/balena-cli.git
synced 2024-12-21 06:33:28 +00:00
Simplify logs promises after review
This commit is contained in:
parent
4388a248b9
commit
e62e8b88c2
@ -50,11 +50,12 @@ module.exports =
|
||||
timestamp = moment(line.timestamp).format('DD.MM.YY HH:mm:ss (ZZ)')
|
||||
console.log("#{timestamp} #{line.message}")
|
||||
|
||||
promise = if options.tail
|
||||
if options.tail
|
||||
resin.logs.subscribe(params.uuid).then (logs) ->
|
||||
logs.on('line', printLine)
|
||||
logs.on('error', done)
|
||||
.catch(done)
|
||||
else
|
||||
resin.logs.history(params.uuid).each(printLine)
|
||||
|
||||
promise.catch(done)
|
||||
resin.logs.history(params.uuid)
|
||||
.each(printLine)
|
||||
.catch(done)
|
||||
|
Loading…
Reference in New Issue
Block a user