Download script, gitignore

This commit is contained in:
eyedeekay
2025-02-20 15:28:09 -05:00
parent 2ee297b4a3
commit 06d95f207f
2 changed files with 33 additions and 0 deletions

1
.gitignore vendored Normal file
View File

@ -0,0 +1 @@
downloads

32
download.sh Executable file
View File

@ -0,0 +1,32 @@
#!/bin/bash
# Set GitHub repo info
OWNER="go-i2p"
REPO="go-gittisane"
echo "Fetching latest release info from GitHub..."
# Get latest release data
RELEASE_DATA=$(curl -s "https://api.github.com/repos/$OWNER/$REPO/releases/latest")
# Extract version number
VERSION=$(echo "$RELEASE_DATA" | grep -Po '"tag_name": "\K.*?(?=")')
echo "Latest version: $VERSION"
# Create downloads directory
mkdir -p downloads
cd downloads
# Download each asset
echo "$RELEASE_DATA" | grep -Po '"browser_download_url": "\K.*?(?=")' | while read -r url; do
filename=$(basename "$url")
echo "Downloading $filename..."
curl -L -o "$filename" "$url"
# Make Linux/macOS binaries executable
if [[ "$filename" != *".exe" ]]; then
chmod +x "$filename"
fi
done
echo "Download complete! Files are in the 'downloads' directory"