Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
#!/usr/bin/env ruby
Dir.chdir("#{ARGV[0]}") do
if File.exist?("PULP_MANIFEST")
`rm -rf PULP_MANIFEST`
end
files = Dir.glob("**/*")
lines = files.collect do |file|
next if File.directory?(file)
line = []
line << file
line << `sha256sum #{file}`.split(' ')[0]
line << `stat -c "%s" #{file}`
line.join(',')
end
File.open("PULP_MANIFEST", 'w') do |file|
file.write(lines.join(""))
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment