mirror of
https://github.com/go-i2p/go-gittisane.git
synced 2025-06-07 09:03:16 -04:00
Download script, gitignore
This commit is contained in:
1
.gitignore
vendored
Normal file
1
.gitignore
vendored
Normal file
@ -0,0 +1 @@
|
||||
downloads
|
32
download.sh
Executable file
32
download.sh
Executable 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"
|
Reference in New Issue
Block a user