diff --git a/CHANGELOG.md b/CHANGELOG.md index dfdd1973..2d077c05 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.0.3 - 2018-03-15 + +* Fix getting window size when there’s no TTY attached #812 [Akis Kesoglou] + ## v7.0.2 - 2018-03-13 * Update full CLI docs with recent installation improvements too #807 [Tim Perry] diff --git a/lib/utils/tty.coffee b/lib/utils/tty.coffee index 22610ce1..20f9dae5 100644 --- a/lib/utils/tty.coffee +++ b/lib/utils/tty.coffee @@ -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 diff --git a/package.json b/package.json index eedda1e5..0f544955 100644 --- a/package.json +++ b/package.json @@ -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",