generators/radix.rb in phlex-icons-tabler-0.16.0 vs generators/radix.rb in phlex-icons-tabler-0.17.0
- old
+ new
@@ -1,11 +1,12 @@
# frozen_string_literal: true
require_relative 'helper'
-REPO_URL = 'https://github.com/radix-ui/icons'
+REPO_URL = 'https://github.com/radix-ui/icons.git'
REPO_NAME = 'radix-ui-icons'
+ICONS_PACK_MODULE_PATH = 'lib/phlex/icons/radix.rb'
ICONS_PACK_PATH = 'lib/phlex/icons/radix'
TEMPLATE = ERB.new <<~TEMPLATE
# frozen_string_literal: true
@@ -23,10 +24,15 @@
end
# rubocop:enable #{ROBOCOP_DISABLE_WARNINGS}
TEMPLATE
def main
- run_generator { icon_file_paths.tqdm.each { create_icon_component(_1) } }
+ run_generator do
+ new_version = JSON.parse(File.read("generators/#{REPO_NAME}/packages/radix-icons/package.json"))['version']
+ update_icon_path_version(new_version)
+
+ icon_file_paths.tqdm.each { create_icon_component(_1) }
+ end
end
def icon_file_paths
Dir.glob("generators/#{REPO_NAME}/packages/radix-icons/icons/*.svg")
end