Skip to content

Instantly share code, notes, and snippets.

@mlebkowski
Created November 30, 2017 14:48
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mlebkowski/da3ed98eae19a13c65bfe30939be1f6b to your computer and use it in GitHub Desktop.
Save mlebkowski/da3ed98eae19a13c65bfe30939be1f6b to your computer and use it in GitHub Desktop.
#!/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