drush-ops / drush-launcher

A small wrapper around Drush for your global $PATH.
GNU General Public License v2.0
237 stars 50 forks source link

Consider changing the installation command so that it will always install the latest version #51

Closed frederickjh closed 4 years ago

frederickjh commented 6 years ago

Please consider changing the installation command so that it will always install the latest version after a new release.

The following command will parse out the link to the latest version and download it. This can be useful when this is scripted for deployments, so it does not need to be changed for each new release.

curl -s -L https://github.com/drush-ops/drush-launcher/releases/latest | egrep -o '/drush-ops/drush-launcher/releases/download/[0-9.]*/drush.phar' | wget --base=http://github.com/ -i - -O drush.phar

More info on this command string

weitzman commented 6 years ago

uses wget AND curl? odd.

i'm ambivalent about adding this.

frederickjh commented 6 years ago

Explanation:

curl -s -L is to silently download the latest release HTML (after following redirect)

egrep -o '...' uses regex to find the file you want

wget --base=http://github.com/ -i - converts the relative path from the pipeline to absolute URL

and -O scollector sets the desired file name.

@weitzman Can you craft the command using only one of them so that it downloads the latest release?

weitzman commented 6 years ago

No I cannot ... ping @webflo to see if he has an opinion on this proposal.

nicolas-san commented 4 years ago

@weitzman @frederickjh following this https://help.github.com/en/github/administering-a-repository/linking-to-releases just using wget -O drush.phar https://github.com/drush-ops/drush-launcher/releases/latest/download/drush.phar works fine

can't we simplify the installation by: wget -O /usr/local/bin/drush https://github.com/drush-ops/drush-launcher/releases/latest/download/drush.phar

and chmod +x /usr/local/bin/drush

weitzman commented 4 years ago

I updated to use the evergreen url for download. lets use a new use for any PATH changes.