Created
November 30, 2017 14:48
-
-
Save mlebkowski/da3ed98eae19a13c65bfe30939be1f6b to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
SOURCE=${SOURCE:-cartoon-dev} | |
TARGET=${TARGET:-cb-live} | |
FILES=(cards.xml cards_finalform.xml cards_mythic.xml levels.xml combos.xml missions.xml) | |
ENDPOINT="http://%s.synapse-games.com/assets/%s" | |
get_diff() { | |
declare file=$1 | |
local source=$(printf "$ENDPOINT" "$SOURCE" "$file") | |
local target=$(printf "$ENDPOINT" "$TARGET" "$file") | |
diff -w --unified=5 <(curl -s "$target") <(curl -s "$source") | |
} | |
main() { | |
for file in ${FILES[@]}; do | |
local diff=$(get_diff "$file") | |
if [ -n "$diff" ]; then | |
echo "Differences in $file" | |
echo "$diff" | |
fi | |
done | |
} | |
main "$@" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment