Skip to content

Commit

Permalink
Catch Interrupt in Interaction.prompt
Browse files Browse the repository at this point in the history
  • Loading branch information
codener committed Nov 22, 2024
1 parent 453076a commit 883039f
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions lib/geordi/interaction.rb
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,8 @@ def prompt(text, default = nil, agreement_regex = nil)
input = default if input.empty? && default

agreement_regex ? !!(input =~ agreement_regex) : input
rescue Interrupt
fail 'Cancelled.'
end

end
Expand Down

0 comments on commit 883039f

Please sign in to comment.