Skip to content
This repository was archived by the owner on Feb 27, 2018. It is now read-only.

Commit dd7a88d

Browse files
Sven DowideitSven Dowideit
authored andcommitted
Merge pull request #225 from SvenDowideit/windows-fix-for-download-script
Fix script on Windows
2 parents 870ff10 + 4cb66f0 commit dd7a88d

1 file changed

Lines changed: 10 additions & 5 deletions

File tree

download.sh

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,9 @@ set -e
44

55
# Set version to latest unless set by user
66
if [ -z "$VERSION" ]; then
7-
VERSION="1.0.1"
7+
VERSION="1.1.2"
88
fi
9+
EXTENSION=""
910

1011
echo "Downloading version ${VERSION}..."
1112

@@ -14,13 +15,15 @@ UNAME=`uname -a`
1415
# Determine platform
1516
if [[ $UNAME == *"Darwin"* ]]; then
1617
PLATFORM="darwin"
17-
elif [[ $UNAME == *"Cygwin"* ]]; then
18+
elif [[ ($UNAME == *MINGW*) || ($UNAME == *Cygwin*) ]]; then
1819
PLATFORM="windows"
20+
EXTENSION=".exe"
21+
UNAME="${PROCESSOR_ARCHITEW6432}"
1922
else
2023
PLATFORM="linux"
2124
fi
2225
# Determine architecture
23-
if [[ ($UNAME == *x86_64*) || ($UNAME == *amd64*) ]]
26+
if [[ ($UNAME == *x86_64*) || ($UNAME == *amd64*) || ($UNAME == *AMD64*) ]]
2427
then
2528
ARCH="amd64"
2629
else
@@ -30,9 +33,11 @@ else
3033
fi
3134

3235
# Download binary
33-
curl -L -o boot2docker "https://github.com/boot2docker/boot2docker-cli/releases/download/v${VERSION}/boot2docker-v${VERSION}-${PLATFORM}_${ARCH}"
36+
URL="https://github.com/boot2docker/boot2docker-cli/releases/download/v${VERSION}/boot2docker-v${VERSION}-${PLATFORM}-${ARCH}${EXTENSION}"
37+
echo "Downloading $URL"
38+
curl -L -o "boot2docker${EXTENSION}" "$URL"
3439

3540
# Make binary executable
36-
chmod +x boot2docker
41+
chmod +x "boot2docker${EXTENSION}"
3742

3843
echo "Done."

0 commit comments

Comments
 (0)