Skip to content

Instantly share code, notes, and snippets.

@ehelms
Created July 26, 2016 14:11
Show Gist options
  • Star 3 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ehelms/3fd956ee887db3d7bac20b29efa3dd51 to your computer and use it in GitHub Desktop.
Save ehelms/3fd956ee887db3d7bac20b29efa3dd51 to your computer and use it in GitHub Desktop.
#!/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