Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
# It wraps the provided JSON file and adds some metadata to it (source, commit, date).
# Based on these instructions:
# Usage:
# ./ ""
# The url must contain the commit hash and should point to a raw JSON file
DATE=`date +%Y-%m-%d`
COMMIT=$(echo "$URL" | sed -E 's/.+\/([a-f0-9]+)\/.+/\1/')
FILENAME=$(echo $URL | sed -E 's/.+\/([^\/]+)$/\1/')
curl $URL | jq -r --arg SOURCE "$URL" --arg COMMIT "$COMMIT" --arg DATE "$DATE" '{ source: $SOURCE, commit: $COMMIT, date: $DATE, tests: .}' > $FILENAME
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.