Skip to content

Instantly share code, notes, and snippets.

@ehelms
Created July 26, 2016 14:11
  • Star 3 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
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