Curl fails to download Drush

Open
#6 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
1/5
Estimated time
Under an hour
Newbie friendliness
35/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Stale
Tech stack
ruby
Domain
devops

Research direction

Inspect lib/capdrupal.rb and the drush:get task, focusing on the curl command used to download Drush. Confirm the download follows the server redirect, then verify that extraction and the subsequent chmod command still run successfully.

Written by the indexing model from the issue text.

Description

Adding the -L parameter fixes the issue

-L: "If the server reports that the requested page has moved to a different location (indicated with a Location: header and a 3XX response code), this option will make curl redo the request on the new place."

diff --git a/lib/capdrupal.rb b/lib/capdrupal.rb
old mode 100644
new mode 100755
index 97f3382..9a54023
--- a/lib/capdrupal.rb
+++ b/lib/capdrupal.rb
@@ -183,7 +183,7 @@ Capistrano::Configuration.instance(:must_exist).load do
   namespace :drush do
     desc "Gets drush and installs it"
     task :get, :roles => :app, :except => { :no_release => true } do
-      run "#{try_sudo} cd #{shared_path} && curl -O -s http://ftp.drupal.org/files/projects/drush-7.x-5.8.tar.gz && tar -xf drush-7.x-5.8.tar.gz && rm drush-7.x-5.8.tar.gz"
+      run "#{try_sudo} cd #{shared_path} && curl -LO -s http://ftp.drupal.org/files/projects/drush-7.x-5.8.tar.gz && tar -xf drush-7.x-5.8.tar.gz && rm drush-7.x-5.8.tar.gz"
       run "#{try_sudo} cd #{shared_path} && chmod u+x drush/drush"
     end
Dominant language
Ruby
Stars
40
Forks
23
PR merge metrics
No merged PRs in 30d

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from capistrano/drupal-deploy

All issues in capistrano/drupal-deploy

Similar issues

More Ruby issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.