This commit is contained in:
BoHung Chiu 2022-08-23 14:03:20 +08:00
parent b4d88412ca
commit f3fed596ee
2 changed files with 2 additions and 1 deletions

View File

@ -128,6 +128,7 @@ class Admin::PersonalPluginFieldsController < OrbitMemberController
def generate_plugin def generate_plugin
template_dir_path = File.expand_path("../../../../template_generator/", __FILE__) + "/" template_dir_path = File.expand_path("../../../../template_generator/", __FILE__) + "/"
cp_template_dir_path = "#{Rails.root}/tmp/#{@personal_plugin_field.module_name}/" cp_template_dir_path = "#{Rails.root}/tmp/#{@personal_plugin_field.module_name}/"
Bundler.with_clean_env { system("cd #{File.dirname(template_dir_path)} && git checkout -- template_generator") }
FileUtils.rm_rf(cp_template_dir_path) FileUtils.rm_rf(cp_template_dir_path)
FileUtils.cp_r(template_dir_path,cp_template_dir_path) FileUtils.cp_r(template_dir_path,cp_template_dir_path)
dirs = Dir.glob("#{cp_template_dir_path}*/") dirs = Dir.glob("#{cp_template_dir_path}*/")

View File

@ -1,4 +1,4 @@
Copyright 2015 YOURNAME Copyright 2022 YOURNAME
Permission is hereby granted, free of charge, to any person obtaining Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the a copy of this software and associated documentation files (the