mirror of
https://github.com/capistrano/capistrano
synced 2023-03-27 23:21:18 -04:00
clearer output on install task
This commit is contained in:
parent
4be1f26248
commit
b1aea6c8c4
2 changed files with 10 additions and 4 deletions
|
@ -9,6 +9,7 @@ en = {
|
|||
restart: 'Restart',
|
||||
finishing: 'Finishing',
|
||||
finished: 'Finished',
|
||||
stage_not_set: 'Stage not set'
|
||||
stage_not_set: 'Stage not set',
|
||||
written_stage_file: 'create config/deploy/%{stage}.rb'
|
||||
}
|
||||
I18n.backend.store_translations(:en, { capistrano: en })
|
||||
|
|
|
@ -6,18 +6,23 @@ task :install do
|
|||
tasks_dir = 'lib/deploy/tasks'
|
||||
config_dir = 'config/deploy'
|
||||
|
||||
deploy_rb = File.read(File.expand_path("../../templates/deploy.rb.erb", __FILE__))
|
||||
deploy_rb = File.expand_path("../../templates/deploy.rb.erb", __FILE__)
|
||||
capfile = File.expand_path("../../templates/Capfile", __FILE__)
|
||||
|
||||
mkdir_p config_dir
|
||||
|
||||
template = File.read(deploy_rb)
|
||||
envs.split(',').each do |stage|
|
||||
File.open("#{config_dir}/#{stage}.rb", 'w+') do |f|
|
||||
f.write(ERB.new(deploy_rb).result(binding))
|
||||
f.write(ERB.new(template).result(binding))
|
||||
puts I18n.t(:written_stage_file, scope: :capistrano, stage: stage)
|
||||
end
|
||||
end
|
||||
|
||||
mkdir_p tasks_dir
|
||||
|
||||
FileUtils.cp(capfile, 'Capfile')
|
||||
|
||||
mkdir_p tasks_dir
|
||||
|
||||
puts I18n.t :capified, scope: :capistrano
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue