Skip to content

Commit

Permalink
abort silently on Ctrl-C during prompts
Browse files Browse the repository at this point in the history
  • Loading branch information
hph authored and mislav committed Dec 18, 2013
1 parent b629b1e commit 67dabf2
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions lib/hub/github_api.rb
Original file line number Diff line number Diff line change
Expand Up @@ -382,6 +382,8 @@ def oauth_token host, user, &block
def prompt what
print "#{what}: "
$stdin.gets.chomp
rescue Interrupt
abort
end

# special prompt that has hidden input
Expand All @@ -395,6 +397,8 @@ def prompt_password host, user
# in testing
$stdin.gets.chomp
end
rescue Interrupt
abort
end

NULL = defined?(File::NULL) ? File::NULL :
Expand Down

0 comments on commit 67dabf2

Please sign in to comment.