Manually copy the file instead of asking Thor to do it
This commit is contained in:
parent
aefcdabb52
commit
7cd6cd233e
|
@ -1,4 +1,5 @@
|
||||||
require "middleman-core"
|
require "middleman-core"
|
||||||
|
require "fileutils"
|
||||||
|
|
||||||
# CLI Module
|
# CLI Module
|
||||||
module Middleman::Cli
|
module Middleman::Cli
|
||||||
|
@ -118,7 +119,17 @@ module Middleman::Cli
|
||||||
output_file = File.join(build_dir, resource.destination_path)
|
output_file = File.join(build_dir, resource.destination_path)
|
||||||
|
|
||||||
if resource.binary?
|
if resource.binary?
|
||||||
copy_file(resource.source_file, output_file)
|
if !File.exists?(output_file)
|
||||||
|
say_status :create, output_file, :green
|
||||||
|
elsif FileUtils.compare_file(resource.source_file, output_file)
|
||||||
|
say_status :identical, output_file, :blue
|
||||||
|
return output_file
|
||||||
|
else
|
||||||
|
say_status :update, output_file, :yellow
|
||||||
|
end
|
||||||
|
|
||||||
|
FileUtils.mkdir_p(File.dirname(output_file))
|
||||||
|
FileUtils.cp(resource.source_file, output_file)
|
||||||
else
|
else
|
||||||
begin
|
begin
|
||||||
response = self.class.shared_rack.get(URI.escape(resource.destination_path))
|
response = self.class.shared_rack.get(URI.escape(resource.destination_path))
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
module Middleman
|
module Middleman
|
||||||
# Current Version
|
# Current Version
|
||||||
# @return [String]
|
# @return [String]
|
||||||
VERSION = '3.0.8.pre.1' unless const_defined?(:VERSION)
|
VERSION = '3.0.8.pre.2' unless const_defined?(:VERSION)
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in a new issue