diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..81662cc --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +downloads \ No newline at end of file diff --git a/download.sh b/download.sh new file mode 100755 index 0000000..0e890e2 --- /dev/null +++ b/download.sh @@ -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" \ No newline at end of file