auto update frontend show page

This commit is contained in:
Peter Chiu 2024-07-22 13:16:48 +08:00
parent b9a2074f11
commit 2b252e0729
1 changed files with 9 additions and 0 deletions

View File

@ -28,6 +28,7 @@ if bundle_update_flag
default_info_contents = JSON.parse(File.read("#{app_path}/modules/event_news_mod/info.json")) rescue {}
default_event_news_index_info = default_info_contents["frontend"].sort_by{|h| h["filename"].to_f} rescue []
default_event_news_widget_info = default_info_contents["widgets"].sort_by{|h| h["filename"].to_f} rescue []
default_event_news_show_info = default_info_contents["show"] rescue nil
all_template.each do |folder|
if !folder.include?('mobile')
if Dir.exist?("#{folder}modules/event_news")
@ -117,6 +118,14 @@ if bundle_update_flag
File.open(info_json_file,"w+"){|f| f.write(info_json)}
end
end
if !default_event_news_show_info.nil?
info["show"] = default_event_news_show_info
default_event_news_show_info.each do |info_detail|
filename = info_detail['filename']
bundler_with_clean_env{%x[cp -f #{app_path}/modules/event_news_mod/#{filename}.html.erb #{folder}modules/event_news_mod/#{filename}.html.erb]}
end
end
end
rescue => e
puts e