From 06d95f207f4585d9b4755d687ab27ac5c64a593c Mon Sep 17 00:00:00 2001 From: eyedeekay Date: Thu, 20 Feb 2025 15:28:09 -0500 Subject: [PATCH] Download script, gitignore --- .gitignore | 1 + download.sh | 32 ++++++++++++++++++++++++++++++++ 2 files changed, 33 insertions(+) create mode 100644 .gitignore create mode 100755 download.sh 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