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:
parent
a44c57861e
commit
d9f3c7852a
1 changed files with 8 additions and 3 deletions
11
bin/pry
11
bin/pry
|
@ -80,7 +80,12 @@ Pry.cli = true
|
||||||
# create the actual context
|
# create the actual context
|
||||||
context = Pry.binding_for(eval(opts[:context]))
|
context = Pry.binding_for(eval(opts[:context]))
|
||||||
|
|
||||||
exec_string = opts[:exec] || ""
|
if opts[:exec]
|
||||||
# run code passed with `-e`, if there is any.
|
exec_string = opts[:exec] + "\n"
|
||||||
Pry.start(context, :input => StringIO.new(exec_string + "\n"), :input_stack => [Readline])
|
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])
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue