This commit is contained in:
BoHung Chiu 2021-05-27 17:43:40 +08:00
parent ba1d01d4ff
commit 474ab7d2e3
1 changed files with 56 additions and 53 deletions

View File

@ -2,12 +2,14 @@ $:.push File.expand_path("../lib", __FILE__)
# Maintain your gem's version: # Maintain your gem's version:
require "faq/version" require "faq/version"
env_pwd = ENV['PWD'] bundle_update_flag = ARGV[0]=='update' || ARGV[0]=='install'
app_path = File.expand_path(__dir__) if bundle_update_flag
template_path = env_pwd + '/app/templates' env_pwd = ENV['PWD']
all_template = Dir.glob(template_path+'/*/') app_path = File.expand_path(__dir__)
default_faq_index_info = JSON.parse(File.read("#{app_path}/modules/faq/info.json"))["frontend"].sort_by{|h| h["filename"].to_i} rescue [] template_path = env_pwd + '/app/templates'
all_template.each do |folder| all_template = Dir.glob(template_path+'/*/')
default_faq_index_info = JSON.parse(File.read("#{app_path}/modules/faq/info.json"))["frontend"].sort_by{|h| h["filename"].to_i} rescue []
all_template.each do |folder|
if !folder.include?('mobile') if !folder.include?('mobile')
info_json_file = "#{folder}modules/faq/info.json" info_json_file = "#{folder}modules/faq/info.json"
if File.exist?(info_json_file) if File.exist?(info_json_file)
@ -64,6 +66,7 @@ all_template.each do |folder|
end end
end end
end end
end
end end
# Describe your gem and declare its dependencies: # Describe your gem and declare its dependencies:
Gem::Specification.new do |s| Gem::Specification.new do |s|