diff options
-rwxr-xr-x | files/drupal | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/files/drupal b/files/drupal index 94cffe9..50b0fcc 100755 --- a/files/drupal +++ b/files/drupal @@ -163,6 +163,7 @@ function drupal_current { } # Get the latest version of a given series +# Operate only on stable releases, filtering out dev, alpha, beta and rc releases # https://drupal.stackexchange.com/questions/23700/how-to-find-download-latest-drupal-version-via-bash#23704 function drupal_latest { local series="$1" @@ -171,7 +172,7 @@ function drupal_latest { series="8" fi - latest="`wget -O- -q https://updates.drupal.org/release-history/drupal/${series}.x | grep -oPm1 "(?<=<download_link>)[^<]+" | head -1`" + latest="`wget -O- -q https://updates.drupal.org/release-history/drupal/${series}.x | grep -oPm1 "(?<=<download_link>)[^<]+" | grep -v -- '-dev' | grep -v -- '-alpha' | grep -v -- '-beta' | grep -v -- '-rc' | head -1`" latest="`basename $latest`" echo $latest | sed -e 's/^drupal-//' -e 's/.tar.gz$//' |