mirror of
https://github.com/mrfluffy-dev/oreo-cursor.git
synced 2026-01-17 13:50:34 +00:00
Bug fixes for convert.rb
This commit is contained in:
@@ -1,5 +1,6 @@
|
|||||||
#!/usr/bin/ruby -w
|
#!/usr/bin/ruby -w
|
||||||
# Frozen_String_Literal: true
|
# Frozen_String_Literal: true
|
||||||
|
require 'fileutils'
|
||||||
|
|
||||||
REPLACE = "#4E81ED".upcase.freeze
|
REPLACE = "#4E81ED".upcase.freeze
|
||||||
BASE = File.join(__dir__, 'oreo_base_cursors')
|
BASE = File.join(__dir__, 'oreo_base_cursors')
|
||||||
@@ -7,6 +8,8 @@ CONFIG_FILE = 'colours.conf'
|
|||||||
|
|
||||||
### Code ###
|
### Code ###
|
||||||
|
|
||||||
|
puts "index.theme not found under #{BASE}" unless Dir.children(BASE).include?('index.theme')
|
||||||
|
|
||||||
colours = {}
|
colours = {}
|
||||||
hex = (?0..?9).to_a + (?a..?f).to_a << ?#
|
hex = (?0..?9).to_a + (?a..?f).to_a << ?#
|
||||||
|
|
||||||
@@ -56,9 +59,12 @@ colours.each do |x, y|
|
|||||||
|
|
||||||
Dir.glob("#{BASE}/*.svg").each do |z|
|
Dir.glob("#{BASE}/*.svg").each do |z|
|
||||||
if File.file?(z)
|
if File.file?(z)
|
||||||
|
dest_file = File.join(dirname, File.basename(z))
|
||||||
data = IO.read(z)
|
data = IO.read(z)
|
||||||
r.each { |c| data.gsub!(c, y) }
|
r.each { |c| data.gsub!(c, y) }
|
||||||
IO.write(File.join(dirname, File.basename(z)), data)
|
IO.write(dest_file, data)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
FileUtils.cp("#{BASE}/index.theme", dirname)
|
||||||
end
|
end
|
||||||
|
|||||||
Reference in New Issue
Block a user