Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 11 additions & 3 deletions lib/whiskey_disk.rb
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,7 @@ def if_file_present(path, cmd)
end

def if_task_defined(task, cmd)
%Q(rakep=`#{env_vars} rake -P` && if [[ `echo "${rakep}" | grep #{task}` != "" ]]; then #{cmd}; fi )
%Q(rakep=`#{env_vars} #{rake} -P` && if [[ `echo "${rakep}" | grep #{task}` != "" ]]; then #{cmd}; fi )
end

def safe_branch_checkout(path, my_branch)
Expand All @@ -226,9 +226,17 @@ def run_rake_task(path, task_name)
enqueue "echo Running rake #{task_name}..."
enqueue "cd #{path}"
enqueue(if_file_present("#{setting(:deploy_to)}/Rakefile",
if_task_defined(task_name, "#{env_vars} rake #{'--trace' if debugging?} #{task_name} to=#{setting(:environment)}")))
if_task_defined(task_name, "#{env_vars} #{rake} #{'--trace' if debugging?} #{task_name} to=#{setting(:environment)}")))
end


def rake
if File.exist?("Gemfile")
"bundle exec rake"
else
"rake"
end
end

def build_path(path)
return path if path =~ %r{^/}
File.join(setting(:deploy_to), path)
Expand Down