1
0
Fork 0
mirror of https://github.com/pry/pry.git synced 2022-11-09 12:35:05 -05:00

fixed tiny bug in bin/pry where no -e parameter still resulted in => nil output

This commit is contained in:
John Mair 2011-09-17 18:23:32 +12:00
parent a44c57861e
commit d9f3c7852a

11
bin/pry
View file

@ -80,7 +80,12 @@ Pry.cli = true
# create the actual context
context = Pry.binding_for(eval(opts[:context]))
exec_string = opts[:exec] || ""
# run code passed with `-e`, if there is any.
Pry.start(context, :input => StringIO.new(exec_string + "\n"), :input_stack => [Readline])
if opts[:exec]
exec_string = opts[:exec] + "\n"
else
exec_string = ""
end
# Start the session (running any code passed with -e, if there is any)
Pry.start(context, :input => StringIO.new(exec_string), :input_stack => [Readline])