Skip to content

Instantly share code, notes, and snippets.

@AlexJameson
Created August 20, 2024 00:25
Show Gist options
  • Save AlexJameson/f2aa27071e305386bef86363135d20e1 to your computer and use it in GitHub Desktop.
Save AlexJameson/f2aa27071e305386bef86363135d20e1 to your computer and use it in GitHub Desktop.
This script downloads the required dictionary from the latest release
#!/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