Skip to content
This repository has been archived by the owner on Nov 1, 2019. It is now read-only.

Commit

Permalink
Update images.json. Bump version. Fix sync.sh to fail on curl failures.
Browse files Browse the repository at this point in the history
  • Loading branch information
schmich committed Mar 17, 2018
1 parent c4e2eb3 commit 4642a5e
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion images.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "hearthstone-card-images",
"version": "3.0.0",
"version": "3.1.0",
"description": "Hearthstone card images for use with HearthstoneJSON data.",
"main": "images.json",
"scripts": {
Expand Down
4 changes: 2 additions & 2 deletions sync.sh
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ fi

# Fetch latest images.json database.
echo 'Downloading latest images.json.'
json=$(curl -Ls https://raw.githubusercontent.com/schmich/hearthstone-card-images/master/images.json)
json=$(curl --fail -Ss -L https://raw.githubusercontent.com/schmich/hearthstone-card-images/master/images.json)
base=$(jq -r .config.base <<< "$json")
cards=$(jq -r '.cards | to_entries[] | [.key, .value[0], .value[1]] | @tsv' <<< "$json")
total=$(wc -l <<< "$cards" | tr -d ' ')
Expand All @@ -45,5 +45,5 @@ while IFS=$'\t' read -r id path hash; do
# Local image doesn't exist or is different. Update it.
url="$base$path/$id.png"
echo "Sync $path/$id.png -> $local_file."
curl -Lso "$local_file" "$url"
curl --fail -Ss -Lo "$local_file" "$url"
done <<< "$cards"

0 comments on commit 4642a5e

Please sign in to comment.