diff --git a/CHANGELOG.md b/CHANGELOG.md index 09459bf3..784d1870 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,10 @@ All notable changes to this project will be documented in this file automatically by Versionist. DO NOT EDIT THIS FILE MANUALLY! This project adheres to [Semantic Versioning](http://semver.org/). +## v7.7.1 - 2018-07-12 + +* Update CLI to SDK v10 (include new API logs) #925 [Tim Perry] + ## v7.7.0 - 2018-07-11 * Add --generate-device-api-key parameter to config generate #921 [Tim Perry] diff --git a/doc/cli.markdown b/doc/cli.markdown index 1ae752f3..e750cec7 100644 --- a/doc/cli.markdown +++ b/doc/cli.markdown @@ -757,10 +757,6 @@ By default, the command prints all log messages and exit. To continuously stream output, and see new logs in real time, use the `--tail` option. -Note that for now you need to provide the whole UUID for this command to work correctly. - -This is due to some technical limitations that we plan to address soon. - Examples: $ resin logs 23c73a1 diff --git a/lib/actions/logs.coffee b/lib/actions/logs.coffee index fa3bd520..9afd197b 100644 --- a/lib/actions/logs.coffee +++ b/lib/actions/logs.coffee @@ -26,10 +26,6 @@ module.exports = To continuously stream output, and see new logs in real time, use the `--tail` option. - Note that for now you need to provide the whole UUID for this command to work correctly. - - This is due to some technical limitations that we plan to address soon. - Examples: $ resin logs 23c73a1 @@ -47,25 +43,19 @@ module.exports = primary: true action: (params, options, done) -> normalizeUuidProp(params) - resin = require('resin-sdk-preconfigured') + resin = require('resin-sdk').fromSharedOptions() moment = require('moment') printLine = (line) -> timestamp = moment(line.timestamp).format('DD.MM.YY HH:mm:ss (ZZ)') console.log("#{timestamp} #{line.message}") - promise = resin.logs.history(params.uuid).each(printLine) - - if not options.tail - - # PubNub keeps the process alive after a history query. - # Until this is fixed, we force the process to exit. - # This of course prevents this command to be used programatically - return promise.catch(done).finally -> - process.exit(0) - - promise.then -> + if options.tail resin.logs.subscribe(params.uuid).then (logs) -> logs.on('line', printLine) logs.on('error', done) - .catch(done) + .catch(done) + else + resin.logs.history(params.uuid) + .each(printLine) + .catch(done) diff --git a/package.json b/package.json index 17b3403e..a1b5d2cd 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "resin-cli", - "version": "7.7.0", + "version": "7.7.1", "description": "The official resin.io CLI tool", "main": "./build/actions/index.js", "homepage": "https://github.com/resin-io/resin-cli", @@ -148,7 +148,7 @@ "resin-multibuild": "^0.5.1", "resin-preload": "^6.3.0", "resin-release": "^1.2.0", - "resin-sdk": "9.0.0-beta18", + "resin-sdk": "10.0.0-beta1", "resin-sdk-preconfigured": "^6.9.0", "resin-settings-client": "^3.6.1", "resin-stream-logger": "^0.1.0",