Simplify logs promises after review

This commit is contained in:
Tim Perry 2018-07-12 15:38:27 +02:00
parent 4388a248b9
commit e62e8b88c2

View File

@ -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)