summaryrefslogtreecommitdiffstats
path: root/vendor/mdbook/ci/install-hub.sh
blob: 38da2c8cbc5023e3fa10d5347d53c6de7681560d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
#!/usr/bin/env bash
# Installs the `hub` executable into hub/bin
set -ex
case $1 in
  ubuntu*)
    curl -LsSf https://github.com/github/hub/releases/download/v2.12.8/hub-linux-amd64-2.12.8.tgz -o hub.tgz
    mkdir hub
    tar -xzvf hub.tgz --strip=1 -C hub
    ;;
  macos*)
    curl -LsSf https://github.com/github/hub/releases/download/v2.12.8/hub-darwin-amd64-2.12.8.tgz -o hub.tgz
    mkdir hub
    tar -xzvf hub.tgz --strip=1 -C hub
    ;;
  windows*)
    curl -LsSf https://github.com/github/hub/releases/download/v2.12.8/hub-windows-amd64-2.12.8.zip -o hub.zip
    7z x hub.zip -ohub
    ;;
  *)
    echo "OS should be first parameter, was: $1"
    ;;
esac

echo "$PWD/hub/bin" >> $GITHUB_PATH