Auto-merge for PR #812 via VersionBot

Fix getting window size when there’s no TTY attached
This commit is contained in:
resin-io-versionbot[bot] 2018-03-15 08:54:19 +00:00 committed by GitHub
commit 5625326c65
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 10 additions and 5 deletions

View File

@ -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.0.3 - 2018-03-15
* Fix getting window size when theres no TTY attached #812 [Akis Kesoglou]
## v7.0.2 - 2018-03-13
* Update full CLI docs with recent installation improvements too #807 [Tim Perry]

View File

@ -2,9 +2,9 @@
windowSize = {}
updateWindowSize = ->
size = require('window-size').get()
windowSize.width = size.width
windowSize.height = size.height
size = require('window-size')?.get()
windowSize.width = size?.width
windowSize.height = size?.height
process.stdout.on('resize', updateWindowSize)
@ -13,7 +13,8 @@ module.exports = (stream = process.stdout) ->
updateWindowSize()
currentWindowSize = ->
# always return a copy
# always return a copy.
# width/height can be undefined if no TTY.
width: windowSize.width
height: windowSize.height

View File

@ -1,6 +1,6 @@
{
"name": "resin-cli",
"version": "7.0.2",
"version": "7.0.3",
"description": "The official resin.io CLI tool",
"main": "./build/actions/index.js",
"homepage": "https://github.com/resin-io/resin-cli",