Use the downloads index to get the latest version

This commit is contained in:
Tilo Spannagel 2017-06-06 15:24:08 +02:00
parent aa40fa7a75
commit d365e45c02
2 changed files with 8 additions and 8 deletions

View File

@ -40,11 +40,11 @@ join() {
echo "${out#$sep}" echo "${out#$sep}"
} }
latest=$(curl -fsSL 'https://nextcloud.com/changelog/' |tac|tac \ latest=$( curl -fsSL 'https://download.nextcloud.com/server/releases/' |tac|tac| \
| grep -o "\(Version\|Release\)\s\+[[:digit:]]\+\(.[[:digit:]]\+\)\+" \ grep -oE 'nextcloud-[[:digit:]]+(.[[:digit:]]+)+' | \
| awk '{ print $2 }' \ grep -oE '[[:digit:]]+(.[[:digit:]]+)+' | \
| sort -uV \ sort -uV | \
| tail -1) tail -1 )
# Generate each of the tags. # Generate each of the tags.
versions=( */ ) versions=( */ )

View File

@ -11,10 +11,10 @@ function version_greater_or_equal() {
[[ "$(printf '%s\n' "$@" | sort -V | head -n 1)" != "$1" || "$1" == "$2" ]]; [[ "$(printf '%s\n' "$@" | sort -V | head -n 1)" != "$1" || "$1" == "$2" ]];
} }
latests=( $(curl -sSL 'https://download.nextcloud.com/server/releases/' |tac|tac| \ latests=( $( curl -fsSL 'https://download.nextcloud.com/server/releases/' |tac|tac| \
grep -oE '>nextcloud-[[:digit:]]+(.[[:digit:]]+)+\.tar\.bz2<' | \ grep -oE 'nextcloud-[[:digit:]]+(.[[:digit:]]+)+' | \
grep -oE '[[:digit:]]+(.[[:digit:]]+)+' | \ grep -oE '[[:digit:]]+(.[[:digit:]]+)+' | \
sort -V ) ) sort -uV ) )
travisEnv= travisEnv=
for latest in "${latests[@]}"; do for latest in "${latests[@]}"; do