From: Giuseppe Bilotta Date: Mon, 7 Jul 2008 15:22:30 +0000 (+0200) Subject: Rakefile: don't fail if .po or .pot file doesn't exist X-Git-Url: https://git.netwichtig.de/gitweb/?a=commitdiff_plain;h=41ee2094532eb26b2bd0577ecbdea55ad0bdb769;p=user%2Fhenk%2Fcode%2Fruby%2Frbot.git Rakefile: don't fail if .po or .pot file doesn't exist --- diff --git a/Rakefile b/Rakefile index 62661bdd..f5b3a126 100644 --- 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