Merge pull request #185 from sebastianludwig/184-fix-xcode-console

Fixed #184 by checking if IO.console is defined
This commit is contained in:
Sebastian Celis 2017-01-19 08:53:29 -06:00 committed by GitHub
commit 76bcd5becd

View file

@ -306,8 +306,13 @@ module Twine
end
end
if IO.console
console_width = IO.console.winsize[1]
else
console_width = 100
end
summary_width += 7 # account for description padding
max_description_width = IO.console.winsize[1] - summary_width
max_description_width = console_width - summary_width
merged_lines.map! do |line|
if line[0] == ' '
line = word_wrap(line.strip, max_description_width - 2)