Created
August 9, 2021 20:15
-
-
Save mridang/c5bfde98456a6e5ec2246ae0481363f3 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/sh | |
| |
sha=$(shasum -b "$1" | awk '{print $1}') | |
url="https://search.maven.org/solrsearch/select?q=1:%22${sha}%22&rows=1&wt=json" | |
if curl -s -o json -L "$url"; then | |
gav=$(jq -r '.response.docs[0].g + ":" + .response.docs[0].a + ":" + .response.docs[0].v' json) | |
if [ "$gav" != "null" ]; then | |
cat gav | |
fi | |
rm -f json | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment