generators/flag.rb in phlex-icons-bootstrap-0.16.0 vs generators/flag.rb in phlex-icons-bootstrap-0.17.0
- old
+ new
@@ -2,10 +2,11 @@
require_relative 'helper'
REPO_URL = 'https://github.com/lipis/flag-icons.git'
REPO_NAME = 'lipis-flag-icons'
+ICONS_PACK_MODULE_PATH = 'lib/phlex/icons/flag.rb'
ICONS_PACK_PATH = 'lib/phlex/icons/flag'
TEMPLATE = ERB.new <<~TEMPLATE
# frozen_string_literal: true
@@ -27,10 +28,15 @@
end
# rubocop:enable #{ROBOCOP_DISABLE_WARNINGS}
TEMPLATE
def main
- run_generator { icon_file_names.tqdm.each { create_icon_component(_1) } }
+ run_generator do
+ new_version = JSON.parse(File.read("generators/#{REPO_NAME}/package.json"))['version']
+ update_icon_path_version(new_version)
+
+ icon_file_names.tqdm.each { create_icon_component(_1) }
+ end
end
def icon_file_names
Dir.glob("generators/#{REPO_NAME}/flags/1x1/*").map { |file| File.basename(file) }
end