From 4eb96f1bca96a58c7d07a38cfde3614441963401 Mon Sep 17 00:00:00 2001 From: Silvio Rhatto Date: Wed, 7 Feb 2018 17:06:52 -0200 Subject: Latest: operate only on stable releases, filtering out dev, alpha, beta and rc releases --- files/drupal | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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 "(?<=)[^<]+" | head -1`" + latest="`wget -O- -q https://updates.drupal.org/release-history/drupal/${series}.x | grep -oPm1 "(?<=)[^<]+" | 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$//' -- cgit v1.2.3