Skip to content

Instantly share code, notes, and snippets.

@iboB
Created December 29, 2019 15:44
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save iboB/4cfd6732747d0a646a365093ebf5c0bd to your computer and use it in GitHub Desktop.
Save iboB/4cfd6732747d0a646a365093ebf5c0bd to your computer and use it in GitHub Desktop.
directory to src_group
groups = {}
Dir['**/*'].each do |f|
s = File.split(f)
dir = s[0]
groups[dir] = [] if !groups[dir]
groups[dir] << s[1]
end
groups.each do |k, v|
puts "src_group(\"#{k.gsub('/', '~')}\" sources"
v.each do |f|
puts " #{k}/#{f}"
end
puts ")"
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment