Created
March 30, 2022 04:37
-
-
Save kucho/3f7f0aaaa46963d2f9c622db375476e2 to your computer and use it in GitHub Desktop.
Install bfg-repo-cleaner
This file contains hidden or 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 | |
set -e | |
# Install Java and jq | |
sudo apt -y install default-jre-headless jq | |
# Get latest version | |
latestVersion=$(curl -s https://search.maven.org/solrsearch/select?q=a:bfg | jq -r '.response.docs[0].latestVersion') | |
# Fetch latest bfg.jar | |
sudo wget https://repo1.maven.org/maven2/com/madgag/bfg/$latestVersion/bfg-$latestVersion.jar -O /usr/local/bin/bfg-latest.jar | |
# Install to /usr/local/bin | |
echo -e "#!/bin/bash\njava -jar /usr/local/bin/bfg-latest.jar \$@" | sudo tee /usr/local/bin/bfg | |
# Make file executable | |
sudo chmod +x /usr/local/bin/bfg |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment