2020-10-28 11:08:49 -04:00
|
|
|
#!/usr/bin/env ruby
|
2021-02-12 07:09:02 -05:00
|
|
|
# frozen_string_literal: true
|
2020-10-28 11:08:49 -04:00
|
|
|
|
|
|
|
require 'json'
|
|
|
|
require_relative '../tooling/lib/tooling/test_map_packer'
|
|
|
|
|
|
|
|
unpacked_json_mapping, packed_json_mapping = ARGV.shift(2)
|
|
|
|
unless packed_json_mapping && unpacked_json_mapping
|
|
|
|
puts "usage: #{__FILE__} <unpacked_json_mapping> <packed_json_mapping>"
|
|
|
|
exit 1
|
|
|
|
end
|
|
|
|
|
|
|
|
puts "Compressing #{unpacked_json_mapping}"
|
|
|
|
|
|
|
|
mapping = JSON.parse(File.read(unpacked_json_mapping))
|
|
|
|
packed_mapping = Tooling::TestMapPacker.new.pack(mapping)
|
|
|
|
|
|
|
|
puts "Writing packed #{packed_json_mapping}"
|
|
|
|
File.write(packed_json_mapping, JSON.generate(packed_mapping))
|
|
|
|
puts "Saved #{packed_json_mapping}."
|