Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 6 additions & 7 deletions install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -127,13 +127,12 @@ if [ -z "$(which hub)" ] || [ "$(hub --version | grep hub\ version | sed -e "s/.
HUB_PLATFORM="linux-amd64"
fi
if [ -n "${HUB_PLATFORM}" ]; then
if [ "${HUB_PLATFORM}" == "darwin-amd64" ]; then
curl -O -L "https://github.com/github/hub/releases/download/v${HUB_VERSION}/hub-${HUB_PLATFORM}-${HUB_VERSION}.tgz"
tar -zxf "hub-${HUB_PLATFORM}-${HUB_VERSION}.tgz" -C "${DIR}" --strip-components 1 "hub-${HUB_PLATFORM}-${HUB_VERSION}"/bin
else
wget "https://github.com/github/hub/releases/download/v${HUB_VERSION}/hub-${HUB_PLATFORM}-${HUB_VERSION}.tgz" -O - | \
tar xz -C "${DIR}" --strip-components 1 "hub-${HUB_PLATFORM}-${HUB_VERSION}/bin" -C "${DIR}" --strip-components 1
fi
TEMP_TGZ="$(mktemp)"
TEMP_DIR="$(mktemp -d)"
curl -o "$TEMP_TGZ" -L "https://github.com/github/hub/releases/download/v${HUB_VERSION}/hub-${HUB_PLATFORM}-${HUB_VERSION}.tgz"
tar -zxf "$TEMP_TGZ" -C "$TEMP_DIR"
prefix="$DIR" "$TEMP_DIR/hub-${HUB_PLATFORM}-${HUB_VERSION}/install"
rm "$TEMP_TGZ"; rm -r "$TEMP_DIR"
else
# There's no easy way to install a recent version of hub: we then create a
# stub with instructions to install it.
Expand Down