Skip to content

Commit

Permalink
Update trunk in Update fetch.sh [skip ci]
Browse files Browse the repository at this point in the history
  • Loading branch information
shivammathur committed Dec 25, 2024
1 parent 3452b4e commit 6f9f6e1
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions scripts/fetch.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@ version=$1
directory=$2
(
cd "$directory" || exit 1
trunk=https://windows.php.net/downloads/releases
trunk=https://downloads.php.net/~windows/releases
semver=$(curl -sL "$trunk"/releases.json | jq -r ".[\"$version\"].version")
if [ "$version" != "${semver%.*}" ]; then
semver=$(curl -sL "$trunk"/archives/ | grep -Po '(?<=HREF=")[^"]*' | grep -Po "$version.[0-9]+" | sort -V | tail -1)
semver=$(curl -sL "$trunk"/archives/ | grep -Po '(?<=href=")[^"]*' | grep -Po "$version.[0-9]+" | sort -V | tail -1)
trunk="$trunk"/archives
fi
curl -sL "$trunk" | grep -Po '(?<=HREF=")[^"]*' | grep -E "$semver" | xargs -n 1 -I{} curl -sLO https://windows.php.net/{}
curl -sL "$trunk" | grep -Po '(?<=href=")[^"]*' | grep -E "$semver" | xargs -n 1 -I{} curl -sLO $trunk/{}
)

0 comments on commit 6f9f6e1

Please sign in to comment.