Skip to content

Commit

Permalink
Fix for windows compatibility
Browse files Browse the repository at this point in the history
  • Loading branch information
greeneca committed Jan 17, 2019
1 parent d9ee691 commit 7a9d0fc
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 11 deletions.
21 changes: 11 additions & 10 deletions lib/roku_builder/plugins/navigator.rb
Expand Up @@ -194,17 +194,18 @@ def generate_maggings
end

def read_char
STDIN.echo = false
STDIN.raw!
input = STDIN.getc.chr
if input == "\e" then
input << STDIN.read_nonblock(3) rescue nil
input << STDIN.read_nonblock(2) rescue nil
STDIN.noecho do |io|
io.raw!
input = STDIN.getc.chr
begin
if input == "\e" then
input << STDIN.read_nonblock(3) rescue nil
input << STDIN.read_nonblock(2) rescue nil
end
end
io.cooked!
input
end
input
ensure
STDIN.echo = true
STDIN.cooked!
end

def handle_navigate_input(char)
Expand Down
2 changes: 1 addition & 1 deletion lib/roku_builder/version.rb
Expand Up @@ -2,5 +2,5 @@

module RokuBuilder
# Version of the RokuBuilder Gem
VERSION = "4.12.2"
VERSION = "4.12.3"
end

0 comments on commit 7a9d0fc

Please sign in to comment.