simplify create_file
This commit is contained in:
parent
425bd603f5
commit
f10db73346
|
@ -19,12 +19,8 @@ module Middleman
|
||||||
begin
|
begin
|
||||||
destination, request_path = SHARED_SERVER_INST.reroute_builder(destination, request_path)
|
destination, request_path = SHARED_SERVER_INST.reroute_builder(destination, request_path)
|
||||||
|
|
||||||
request_path.gsub!(/\s/, "%20")
|
response = Middleman::Builder.shared_rack.get(request_path.gsub(/\s/, "%20"))
|
||||||
response = Middleman::Builder.shared_rack.get(request_path)
|
create_file(destination, response.body, config) if response.status == 200
|
||||||
|
|
||||||
create_file destination, nil, config do
|
|
||||||
response.body
|
|
||||||
end if response.status == 200
|
|
||||||
rescue
|
rescue
|
||||||
say_status :error, destination, :red
|
say_status :error, destination, :red
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in a new issue