automate/020_drush.phar.sh

11 lines
419 B
Bash
Executable File

#!/usr/bin/env bash
set +x
PROJECT=drush-ops/drush-launcher
RELEASE=$(curl "https://api.github.com/repos/${PROJECT}/releases?per_page=5" | jq -r '.[0] | .tag_name')
VERSION=$(echo "${RELEASE}" | cut -c 2- | cut -f1 -d"-")
DOWNLOAD_DIR=/tmp
wget -c --directory-prefix "${DOWNLOAD_DIR}" https://github.com/${PROJECT}/releases/download/"${RELEASE}"/drush.phar
chmod +x drush.phar && \
mv drush.phar /usr/local/bin/drush