提交 b0645ea0 编写于 作者: A Aaron Patterson

avoid object creation if there is no rc file

上级 f7ae6e1c
......@@ -363,7 +363,6 @@ def railsrc(argv)
end
def read_rc_file(railsrc)
return [] unless File.exists?(railsrc)
extra_args_string = File.read(railsrc)
extra_args = extra_args_string.split(/\n+/).map {|l| l.split}.flatten
puts "Using #{extra_args.join(" ")} from #{railsrc}"
......@@ -371,6 +370,7 @@ def read_rc_file(railsrc)
end
def insert_railsrc_into_argv!(argv, railsrc)
return argv unless File.exists?(railsrc)
extra_args = read_rc_file railsrc
argv.take(1) + extra_args + argv.drop(1)
end
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册