mirror of
https://github.com/balena-io/balena-cli.git
synced 2025-03-22 12:05:20 +00:00
Auto-merge for PR #812 via VersionBot
Fix getting window size when there’s no TTY attached
This commit is contained in:
commit
5625326c65
@ -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]
|
||||
|
@ -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
|
||||
|
||||
|
@ -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",
|
||||
|
Loading…
x
Reference in New Issue
Block a user