debian-mirror-gitlab/scripts/unpack-test-mapping

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

19 lines
591 B
Text
Raw Normal View History

2021-01-29 00:20:46 +05:30
#!/usr/bin/env ruby
2021-03-11 19:13:27 +05:30
# frozen_string_literal: true
2021-01-29 00:20:46 +05:30
require 'json'
require_relative '../tooling/lib/tooling/test_map_packer'
packed_json_mapping, unpacked_json_mapping = ARGV.shift(2)
unless packed_json_mapping && unpacked_json_mapping
puts "usage: #{__FILE__} <packed_json_mapping> <unpacked_json_mapping>"
exit 1
end
packed_mapping = JSON.parse(File.read(packed_json_mapping))
mapping = Tooling::TestMapPacker.new.unpack(packed_mapping)
puts "Writing unpacked #{unpacked_json_mapping}"
File.write(unpacked_json_mapping, JSON.generate(mapping))
puts "Saved #{unpacked_json_mapping}."