]> git.netwichtig.de Git - user/henk/code/ruby/rbot.git/commitdiff
Rakefile: don't fail if .po or .pot file doesn't exist
authorGiuseppe Bilotta <giuseppe.bilotta@gmail.com>
Mon, 7 Jul 2008 15:22:30 +0000 (17:22 +0200)
committerGiuseppe Bilotta <giuseppe.bilotta@gmail.com>
Mon, 7 Jul 2008 17:00:24 +0000 (19:00 +0200)
Rakefile

index 62661bdd35cf46341d0db3bf42742ffddf9bd18d..f5b3a1261b267b5a0a484763b05514d8819cfaae 100644 (file)
--- a/Rakefile
+++ b/Rakefile
@@ -77,7 +77,7 @@ task :define_po_rules do
     GetText.rgettext(source_files, new_pot_file)
 
     # only use the new pot file if it contains unique messages
-    if MSGCOMM && `#{MSGCOMM} --unique #{pot_file} #{new_pot_file}`.empty?
+    if File.exists?(pot_file) && MSGCOMM && `#{MSGCOMM} --unique #{pot_file} #{new_pot_file}`.empty?
       rm new_pot_file
     else
       mv new_pot_file, pot_file
@@ -105,7 +105,11 @@ task :define_po_rules do
     require 'gettext/utils'
     po_file, pot_file = t.name, t.source
     puts "#{pot_file} => #{po_file}"
-    sh "#{MSGMERGE} --backup=off --update #{po_file} #{pot_file}"
+    if File.exists? po_file
+      sh "#{MSGMERGE} --backup=off --update #{po_file} #{pot_file}"
+    else
+      cp pot_file, po_file
+    end
     normalize_po(po_file)
     touch po_file
   end