summaryrefslogtreecommitdiff
path: root/Rakefile
diff options
context:
space:
mode:
authorGiuseppe Bilotta <giuseppe.bilotta@gmail.com>2008-07-07 17:22:30 +0200
committerGiuseppe Bilotta <giuseppe.bilotta@gmail.com>2008-07-07 19:00:24 +0200
commit41ee2094532eb26b2bd0577ecbdea55ad0bdb769 (patch)
tree62fee950754efbf3dd8a2b504397379211e961cb /Rakefile
parent5abc0b68520c1a1ae9998f71bdfb7221aaf7b6ee (diff)
Rakefile: don't fail if .po or .pot file doesn't exist
Diffstat (limited to 'Rakefile')
-rw-r--r--Rakefile8
1 files changed, 6 insertions, 2 deletions
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