Convert.rb to only iterate on .svg.oreo files

This commit is contained in:
Sourav Goswami
2020-08-24 21:53:49 +05:30
parent 6b7c0c10a6
commit ad8a44d99b

View File

@@ -1,9 +1,13 @@
#!/usr/bin/env ruby #!/usr/bin/env ruby
# Frozen_String_Literal: true # Frozen_String_Literal: true
# Written by Sourav Goswami <souravgoswami@protonmail.com>
BASE = File.join(__dir__, 'oreo_base_cursors') BASE = File.join(__dir__, 'oreo_base_cursors')
# Configuration file to read
CONFIG_FILE = 'colours.conf' CONFIG_FILE = 'colours.conf'
# Output directory
OUT_DIR = File.join(File.expand_path('..', __dir__), 'src') OUT_DIR = File.join(File.expand_path('..', __dir__), 'src')
# Content of index.theme inside each theme # Content of index.theme inside each theme
@@ -100,9 +104,9 @@ colours.each do |x, y|
File.delete(file) File.delete(file)
end end
Dir.glob("#{BASE}/*.svg").each do |z| Dir.glob("#{BASE}/*svg.oreo").each do |z|
if File.file?(z) if File.file?(z)
dest_file = File.join(dirname, File.basename(z)) dest_file = File.join(dirname, File.basename(z).split(?.).tap(&:pop).join(?.))
data = IO.read(z) data = IO.read(z)
# Background Colour # Background Colour