Skip to content

Instantly share code, notes, and snippets.

@Alexander-Ignition
Created March 12, 2016 05:48
Show Gist options
  • Save Alexander-Ignition/afac3716e55c51da86f6 to your computer and use it in GitHub Desktop.
Save Alexander-Ignition/afac3716e55c51da86f6 to your computer and use it in GitHub Desktop.
require 'digest/sha1'
require 'json'
file_names = Dir.entries(".").select do |f|
f.end_with?(".png") || f == "pass.json"
end
manifest = {}
file_names.each do |f|
manifest[f] = Digest::SHA2.hexdigest(File.read(f))
end
File.open("manifest.json", "w") do |f|
f.write(JSON.pretty_generate(manifest))
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment