This commit is contained in:
BoHung Chiu 2021-11-18 19:48:16 +08:00
parent 72a5ed3360
commit 4118f5d7f6
1 changed files with 58 additions and 55 deletions

View File

@ -8,13 +8,15 @@ begin
rescue => e rescue => e
puts [e.to_s,e.backtrace] puts [e.to_s,e.backtrace]
end end
require "json" bundle_update_flag = ARGV[0]=='update' || ARGV[0]=='install'
env_pwd = ENV['PWD'] if bundle_update_flag
app_path = File.expand_path(__dir__) require "json"
template_path = env_pwd + '/app/templates' env_pwd = ENV['PWD']
all_template = Dir.glob(template_path+'/*/') app_path = File.expand_path(__dir__)
default_seminar_widget_info = JSON.parse(File.read("#{app_path}/modules/seminar/info.json"))["widgets"].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_seminar_widget_info = JSON.parse(File.read("#{app_path}/modules/seminar/info.json"))["widgets"].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/seminar/info.json" info_json_file = "#{folder}modules/seminar/info.json"
if File.exist?(info_json_file) if File.exist?(info_json_file)
@ -72,6 +74,7 @@ all_template.each do |folder|
end end
end end
end end
end
end end
Gem::Specification.new do |s| Gem::Specification.new do |s|
s.name = "seminar" s.name = "seminar"