#!/usr/bin/env bash

download_gogs() {
    # Fetch latest package, via GitHub API v3
    wget "$(curl -H \
         'Accept: application/vnd.github.v3+json' \
         --silent \
         "https://api.github.com/repos/gogits/gogs/releases/latest" \
        | grep browser_download_url \
        | cut -d '"' -f 4 \
        | grep 'linux_amd64.tar.gz$')"
}

main() {
    download_gogs
}

main
