From fe01ead0234181478e862a30aa49d48c261e42a8 Mon Sep 17 00:00:00 2001 From: Akis Kesoglou Date: Thu, 15 Mar 2018 10:24:25 +0200 Subject: [PATCH 1/2] =?UTF-8?q?Fix=20getting=20window=20size=20when=20ther?= =?UTF-8?q?e=E2=80=99s=20no=20TTY=20attached?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Change-Type: patch --- lib/utils/tty.coffee | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) 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 From b9124198392dc1ab83b80bf8557a35a97d062691 Mon Sep 17 00:00:00 2001 From: "resin-io-versionbot[bot]" Date: Thu, 15 Mar 2018 08:47:28 +0000 Subject: [PATCH 2/2] v7.0.3 --- CHANGELOG.md | 4 ++++ package.json | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) 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/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",