Sha256: 0804ca7dd210704cf887c57222ec08b41c3f5dbbe9ed2d18b714bc2daf2d4d06

Contents?: true

Size: 962 Bytes

Versions: 2

Compression:

Stored size: 962 Bytes

Contents

require 'fileutils'
require_relative '../../lib/image_compressor_pack/recipes'

root = File.expand_path("../../../", __FILE__)

recipes = ImageCompressorPack.recipes

recipes.each do |recipe|
  checkpoint = "#{recipe.target}/#{recipe.name}-#{recipe.version}-#{recipe.host}.installed"
  unless File.exist?(checkpoint)
    `rm -rf tmp/#{recipe.host}/ports/#{recipe.name}/#{recipe.version}`
    recipe.cook
    FileUtils.touch checkpoint
  end
  recipe.activate
end

absolute_paths = Dir.glob(File.join(root, 'ports', recipes.first.host, '**', 'bin'))
relative_paths = absolute_paths.map { |path| path.gsub(/#{root}\//, '') }

File.open(File.join(root, 'lib', '.paths.yml'), 'w') do |f|
  f.puts relative_paths.to_yaml
end

source_makefile = File.join(root, 'Makefile')
destination_makefile = 'Makefile'

unless File.exist?(destination_makefile) and File.identical?(source_makefile, destination_makefile)
  FileUtils.cp(File.join(root, 'Makefile'), 'Makefile')
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
image_compressor_pack-0.1.1 ext/image_compressor_pack/extconf.rb
image_compressor_pack-0.1.1.rc2 ext/image_compressor_pack/extconf.rb