diff options
author | Ralph Amissah <ralph@amissah.com> | 2012-06-03 14:28:19 -0400 |
---|---|---|
committer | Ralph Amissah <ralph@amissah.com> | 2012-06-03 14:28:19 -0400 |
commit | 33417c59a25d9c68698d319d298da1fecaec1673 (patch) | |
tree | 4569559a60a292dcfafd4aee82425655ea4afb22 /lib/sisu/v3/sysenv.rb | |
parent | v3: error & warning messages touched, revisit (diff) |
v3: warn when files to be copied not found, add
Diffstat (limited to 'lib/sisu/v3/sysenv.rb')
-rw-r--r-- | lib/sisu/v3/sysenv.rb | 17 |
1 files changed, 13 insertions, 4 deletions
diff --git a/lib/sisu/v3/sysenv.rb b/lib/sisu/v3/sysenv.rb index 977fd3fe..e03c668d 100644 --- a/lib/sisu/v3/sysenv.rb +++ b/lib/sisu/v3/sysenv.rb @@ -2141,7 +2141,10 @@ WOK src="#{path.share}/image" images=%W[bullet_09.png arrow_next_red.png arrow_prev_red.png arrow_up_red.png] images.each do |i| #move to avoid repeated tests - FileUtils::cp("#{src}/#{i}","#{pth}/#{i}") unless FileTest.file?("#{pth}/#{i}") + if FileTest.file?("#{src}/#{i}") + FileUtils::cp("#{src}/#{i}","#{pth}/#{i}") unless FileTest.file?("#{pth}/#{i}") + else STDERR.puts %{\t*WARN* did not find image - "#{i}" [#{__FILE__}:#{__LINE__}]} + end end pth end @@ -5882,8 +5885,11 @@ WOK FileUtils::mkdir_p(dest_path) unless FileTest.directory?(dest_path) FileUtils::chmod(0755,dest_path) source.each do |i| - FileUtils::cp_r(i,"#{dest_path}/#{i}") - FileUtils::chmod(0644,"#{dest_path}/#{i}") + if FileTest.file?(i) + FileUtils::cp(i,"#{dest_path}/#{i}") + FileUtils::chmod(0644,"#{dest_path}/#{i}") + else STDERR.puts %{\t*WARN* did not find image - "#{i}" [#{__FILE__}:#{__LINE__}]} + end end FileUtils::cd(@pwd) else STDERR.puts %{\t*WARN* did not find - #{src_path} [#{__FILE__}:#{__LINE__}]} @@ -5927,7 +5933,10 @@ WOK FileUtils::cd(x) source=Dir.glob("*.{css}") source.each do |i| - FileUtils::cp(i,"#{@env.path.output}/#{@env.path.style}") + if FileTest.file?(i) + FileUtils::cp(i,"#{@env.path.output}/#{@env.path.style}") + else STDERR.puts %{\t*WARN* did not find css - "#{i}" [#{__FILE__}:#{__LINE__}]} + end end FileUtils::cd(@pwd) end |