Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

debrew: restore ARGV even when IRB.setup raises

  • Loading branch information...
commit 12b2f94946bf721c457176a5652b37ec5dac033a 1 parent 225546a
@jacknagel jacknagel authored
Showing with 6 additions and 3 deletions.
  1. +6 −3 Library/Homebrew/debrew/irb.rb
View
9 Library/Homebrew/debrew/irb.rb
@@ -6,9 +6,12 @@ module IRB
def IRB.start_within(binding)
unless @setup_done
# make IRB ignore our command line arguments
- saved_args = ARGV.shift(ARGV.size)
- IRB.setup(nil)
- ARGV.concat(saved_args)
+ begin
+ saved_args = ARGV.shift(ARGV.size)
+ IRB.setup(nil)
+ ensure
+ ARGV.replace(saved_args)
+ end
@setup_done = true
end
Please sign in to comment.
Something went wrong with that request. Please try again.