Created
December 29, 2019 15:44
-
-
Save iboB/4cfd6732747d0a646a365093ebf5c0bd to your computer and use it in GitHub Desktop.
directory to src_group
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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