"ୈ1Ҿʹ ஔ͍ͨ͠ը૾໊ҰཡcsvϑΝΠϧ ͷpathΛɺୈ2Ҿʹ Storyboard/xib ؚ͕·ΕΔσΟϨΫτϦͷpathΛ༩͍͑ͯͩ͘͞ɻ" exit end image_names_path = ARGV[0] if File.extname(image_names_path) != ".csv" then puts "ୈ1Ҿʹࢦఆ͞ΕͨϑΝΠϧcsvϑΝΠϧͰ͋Γ·ͤΜɻਖ਼͍͠ϑΝΠϧΛࢦఆ͍ͯͩ͘͠͞ɻ" exit end root_path = ARGV[1] image_names = CSV.read(image_names_path) image_names.each { |names| old_name = names[0] new_name = names[1] next if new_name.nil? || old_name.nil? puts "#{old_name} => #{new_name}" [ ["<image name=\"#{old_name}\"", "<image name=\"#{new_name}\""], ["value=\"#{old_name}\"", "value=\"#{new_name}\""], ["image=\"#{old_name}\"", "image=\"#{new_name}\""], ["R.image.#{old_name}()", "R.image.#{new_name}()"] ].each { |texts| command = "grep -lr '#{texts.first}' #{root_path} | xargs sed -i '' -e 's/#{texts.first}/#{texts.last}/g'" system(command) } } puts "Completed!" ը૾໊ ৽چ ஔεΫϦϓτ.rb