Skip to content

Commit 161dacd

Browse files
committed
[Hub] Add manual for hub.
1 parent 2478f37 commit 161dacd

File tree

1 file changed

+6
-7
lines changed

1 file changed

+6
-7
lines changed

install.sh

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -127,13 +127,12 @@ if [ -z "$(which hub)" ] || [ "$(hub --version | grep hub\ version | sed -e "s/.
127127
HUB_PLATFORM="linux-amd64"
128128
fi
129129
if [ -n "${HUB_PLATFORM}" ]; then
130-
if [ "${HUB_PLATFORM}" == "darwin-amd64" ]; then
131-
curl -O -L "https://github.com/github/hub/releases/download/v${HUB_VERSION}/hub-${HUB_PLATFORM}-${HUB_VERSION}.tgz"
132-
tar -zxf "hub-${HUB_PLATFORM}-${HUB_VERSION}.tgz" -C "${DIR}" --strip-components 1 "hub-${HUB_PLATFORM}-${HUB_VERSION}"/bin
133-
else
134-
wget "https://github.com/github/hub/releases/download/v${HUB_VERSION}/hub-${HUB_PLATFORM}-${HUB_VERSION}.tgz" -O - | \
135-
tar xz -C "${DIR}" --strip-components 1 "hub-${HUB_PLATFORM}-${HUB_VERSION}/bin" -C "${DIR}" --strip-components 1
136-
fi
130+
TEMP_TGZ="$(mktemp)"
131+
TEMP_DIR="$(mktemp -d)"
132+
curl -o "$TEMP_TGZ" -L "https://github.com/github/hub/releases/download/v${HUB_VERSION}/hub-${HUB_PLATFORM}-${HUB_VERSION}.tgz"
133+
tar -zxf "$TEMP_TGZ" -C "$TEMP_DIR"
134+
prefix="$DIR" "$TEMP_DIR/hub-${HUB_PLATFORM}-${HUB_VERSION}/install"
135+
rm "$TEMP_TGZ"; rm -r "$TEMP_DIR"
137136
else
138137
# There's no easy way to install a recent version of hub: we then create a
139138
# stub with instructions to install it.

0 commit comments

Comments
 (0)