diff options
author | Giuseppe Bilotta <giuseppe.bilotta@gmail.com> | 2008-07-07 17:22:30 +0200 |
---|---|---|
committer | Giuseppe Bilotta <giuseppe.bilotta@gmail.com> | 2008-07-07 19:00:24 +0200 |
commit | 41ee2094532eb26b2bd0577ecbdea55ad0bdb769 (patch) | |
tree | 62fee950754efbf3dd8a2b504397379211e961cb | |
parent | 5abc0b68520c1a1ae9998f71bdfb7221aaf7b6ee (diff) |
Rakefile: don't fail if .po or .pot file doesn't exist
-rw-r--r-- | Rakefile | 8 |
1 files changed, 6 insertions, 2 deletions
@@ -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 |