Skip to content

Commit 163f643

Browse files
committed
Improve "update.sh" reliability by using "jq" instead of "sed" for parsing JSON
1 parent c9dfce1 commit 163f643

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

update.sh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
#!/bin/bash
2-
set -eo pipefail
2+
set -euo pipefail
33

4-
current="$(curl -sSL 'http://api.wordpress.org/core/version-check/1.7/' | sed -r 's/^.*"current":"([^"]+)".*$/\1/')"
4+
current="$(curl -fsSL 'http://api.wordpress.org/core/version-check/1.7/' | jq -r '.offers[0].current')"
55

6-
sha1="$(curl -sSL "https://wordpress.org/wordpress-$current.tar.gz.sha1")"
6+
sha1="$(curl -fsSL "https://wordpress.org/wordpress-$current.tar.gz.sha1")"
77

88
travisEnv=
99
for variant in apache fpm; do

0 commit comments

Comments
 (0)