From d901a681d0926b7c840e4c3f9915c42b8f1f32f0 Mon Sep 17 00:00:00 2001 From: Sam Bosley Date: Fri, 30 Nov 2012 11:08:15 -0800 Subject: [PATCH] Fixed for loops and syntax errors --- bin/getloc.rb | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/bin/getloc.rb b/bin/getloc.rb index ac11d61c5..4211e5d9b 100755 --- a/bin/getloc.rb +++ b/bin/getloc.rb @@ -5,7 +5,7 @@ def lang_mod(lang) end def export(tmp_files, src_files, lang, android) - for i in 0..tmp_files.length + for i in 0...tmp_files.length %x(cp #{src_files[i]} #{tmp_files[i]}) if src_files[i] != tmp_files[i] end @@ -44,8 +44,8 @@ def import(tmp_files, dst_files, lang, android) # Get all translations Dir.foreach(tmp_all_dir) do |f| - if (f != "." && f != "..")i - for i in 0..tmp_files.length + if (f != "." && f != "..") + for i in 0...tmp_files.length file = File.join(tmp_all_dir, f, File.basename(t)) %x(sed -i '' "s/'/\\\\\\'/g" #{file}) if android puts "Moving #{file} to #{dst_files[i]}" @@ -57,7 +57,7 @@ def import(tmp_files, dst_files, lang, android) %x(rm #{tmp_all}) else lang_tmp = lang_mod(lang) - for i in 0..tmp_files.length + for i in 0...tmp_files.length name = File.basename(tmp_files[i]) %x(curl --user #{@user}:#{@password} https://api.getlocalization.com/astrid/api/translations/file/#{name}/#{lang_tmp}/ -o #{tmp_files[i]}) %x(sed -i '' "s/'/\\\\\\'/g" #{tmp_files[i]}) if android