From 1dde1528013dcdbe0da482b21436eda0f0eeaf75 Mon Sep 17 00:00:00 2001 From: Michael Nikitochkin Date: Wed, 25 Sep 2013 17:04:35 +0300 Subject: [PATCH] :panda_face: Split creation of linked files dirs from testing the files. --- lib/capistrano/tasks/deploy.rake | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/lib/capistrano/tasks/deploy.rake b/lib/capistrano/tasks/deploy.rake index 33821061..101e5662 100644 --- a/lib/capistrano/tasks/deploy.rake +++ b/lib/capistrano/tasks/deploy.rake @@ -35,6 +35,7 @@ namespace :deploy do invoke "#{scm}:check" invoke 'deploy:check:directories' invoke 'deploy:check:linked_dirs' + invoke 'deploy:check:make_linked_dirs' invoke 'deploy:check:linked_files' end @@ -53,12 +54,19 @@ namespace :deploy do execute :mkdir, '-pv', linked_dirs(shared_path) end end + + desc 'Check directories of files to be linked exist in shared' + task :make_linked_dirs do + next unless any? :linked_files + on roles :app do |host| + execute :mkdir, '-pv', linked_file_dirs(shared_path) + end + end desc 'Check files to be linked exist in shared' task :linked_files do next unless any? :linked_files on roles :app do |host| - execute :mkdir, '-pv', linked_file_dirs(shared_path) linked_files(shared_path).each do |file| unless test "[ -f #{file} ]" error t(:linked_file_does_not_exist, file: file, host: host)