Add force update templates.

This commit is contained in:
BoHung Chiu 2022-07-26 19:26:46 +08:00
parent 658addea48
commit b8d1a4d975
1 changed files with 16 additions and 1 deletions

View File

@ -2,7 +2,22 @@ $:.push File.expand_path("../lib", __FILE__)
# Maintain your gem's version:
require "personal_activity/version"
bundle_update_flag = ARGV[0]=='update' || ARGV[0]=='install'
if bundle_update_flag
app_path = File.expand_path(__dir__)
template_path = ENV['PWD'] + '/app/templates'
all_template = Dir.glob(template_path+'/*/')
puts 'copying module'
all_template.each do |folder|
if folder.split('/')[-1] != 'mobile'
begin
system ('cp -r '+ app_path + '/modules/ ' + folder)
rescue
puts 'error copy'
end
end
end
end
# Describe your gem and declare its dependencies:
Gem::Specification.new do |s|
s.name = "personal_activity"