#!/bin/bash # Usage: curl -fsSL https://github.com/github/hub/raw/master/script/get | bash -s # # Downloads the hub binary into `bin/hub` within the current directory. set -e latest-version() { curl -fsi https://github.com/github/hub/releases/latest | awk -F/ 'tolower($1) ~ /^location:/ {print $(NF)}' } HUB_VERSION="${1#v}" if [ -z "$HUB_VERSION" ]; then latest=$(latest-version) || true [ -n "$latest" ] || latest="v2.14.1" cat <&2 Error: You must specify a version of hub via the first argument. Example: curl -L