#!/usr/bin/env bash case "$OSTYPE" in darwin*) re='mac_amd64.*\.tar\.gz'; ;; linux*) re='linux_amd64.*\.tar\.gz'; ;; msys*) re='windows_amd64.*\.zip'; ;; *) echo "unknown: $OSTYPE"; ;; esac rel=$(wget -qO- https://latest.fast.ai/latest/caddyserver/caddy | grep $re) if [[ $name == "windows_amd64" ]]; then wget -qO- ${rel} unzip *.zip else wget -qO- ${rel} | tar xz fi