mirror of
https://github.com/alacritty/alacritty.git
synced 2024-11-18 13:55:23 -05:00
22 lines
461 B
Ruby
22 lines
461 B
Ruby
|
#!/usr/bin/env ruby
|
||
|
|
||
|
require 'json'
|
||
|
|
||
|
Dir.glob('./tests/ref/**/grid.json').each do |path|
|
||
|
# Read contents
|
||
|
s = File.open(path) { |f| f.read }
|
||
|
|
||
|
# Parse
|
||
|
grid = JSON.parse(s)
|
||
|
|
||
|
# Check if it's already migrated / make this migration idempotent
|
||
|
next if grid['raw'][0][0].is_a? Array
|
||
|
|
||
|
# Transform
|
||
|
grid['raw'].reverse!
|
||
|
grid['raw'] = [grid['raw'], 0, grid['lines'] - 1]
|
||
|
|
||
|
# Write updated grid
|
||
|
File.open(path, 'w') { |f| f << JSON.generate(grid) }
|
||
|
end
|