App-Open-Source-per-iPhone-.../.github/osia_get_history.rb

25 lines
401 B
Ruby

require_relative 'osia_helper'
HISTORY = 'git_history'
j = get_json
apps = j['projects']
h = {}
apps.each_with_index do |a, i|
t = a['title']
puts "#{i + 1}/#{apps.count}. checking #{t}"
command = "git log --all --grep='#{t}'"
begin
r = `#{command}`
rescue e
r = e
end
h[t] = r
end
File.open(HISTORY, 'w') { |f| f.write JSON.pretty_generate h }
puts "wrote #{HISTORY}"