Created
August 20, 2024 00:25
-
-
Save AlexJameson/f2aa27071e305386bef86363135d20e1 to your computer and use it in GitHub Desktop.
This script downloads the required dictionary from the latest release
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 | |
REPO="AlexJameson/software-development-dictionary-ru" | |
LATEST_RELEASE=$(curl -s https://api.github.com/repos/$REPO/releases/latest) | |
DOWNLOAD_URL=$(echo $LATEST_RELEASE | grep -o '"browser_download_url": "[^"]*sdd.txt"' | cut -d '"' -f 4) | |
VERSION=$(echo $LATEST_RELEASE | grep -o '"tag_name": "[^"]*"' | cut -d '"' -f 4) | |
if [ -n "$DOWNLOAD_URL" ]; then | |
curl -L -o sdd.txt "$DOWNLOAD_URL" | |
echo "Downloaded sdd.txt from version $VERSION" | |
else | |
echo "Error: Could not find sdd.txt in the latest release" | |
exit 1 | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment