Skip to content

Instantly share code, notes, and snippets.

@hut8
Created April 13, 2016 17:25
Show Gist options
  • Save hut8/8deec806b5b652ef0bf76a6c6e2fe375 to your computer and use it in GitHub Desktop.
Save hut8/8deec806b5b652ef0bf76a6c6e2fe375 to your computer and use it in GitHub Desktop.
#!/usr/bin/env ruby
# frozen_string_literal: true
require 'json'
require 'open-uri'
components = JSON.parse(open('https://rails-assets.org/components.json').read)
i = 0
components.each do |c|
cn = c['name']
c['versions'].each do |v|
cv = "#{cn}##{v}"
outpath = "/home/liam/bower-dep-trees/#{cn}"
outfile = "/home/liam/bower-dep-trees/#{cn}/#{cv}.txt"
puts "[ -e #{outfile} ] || (mkdir -p #{outpath}; bower-dependency-tree --production '#{cv}' &> #{outfile});"
i += 1
puts 'bower cache clean' if i % 1000 == 0
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment