-
Notifications
You must be signed in to change notification settings - Fork 3
/
update.sh
executable file
·29 lines (22 loc) · 1.15 KB
/
update.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
#!/bin/bash
if [ "$1" = "" ]; then
echo "Usage: $0 version"
echo "Update the choco package to a given version"
echo "Example: $0 1.10.3"
exit 1
fi
if [[ "${OSTYPE}" != "darwin"* ]]; then
echo "This version does only support Mac."
exit 2
fi
version=$1
url="https://github.com/docker/machine/releases/download/v${version}/docker-machine-Windows-i386.exe"
url64="https://github.com/docker/machine/releases/download/v${version}/docker-machine-Windows-x86_64.exe"
checksum=$(curl -L "${url}" | shasum -a 256 | cut -f 1 -d " ")
checksum64=$(curl -L "${url64}" | shasum -a 256 | cut -f 1 -d " ")
sed -i.bak "s/<version>.*<\/version>/<version>${version}<\/version>/" docker-machine.nuspec
sed -i.bak "s/version: .*{build}/version: ${version}.{build}/" appveyor.yml
sed -i.bak "s!^\$url = '.*'!\$url = '${url}'!" tools/chocolateyInstall.ps1
sed -i.bak "s/^\$checksum = '.*'/\$checksum = '${checksum}'/" tools/chocolateyInstall.ps1
sed -i.bak "s!^\$url64 = '.*'!\$url64 = '${url64}'!" tools/chocolateyInstall.ps1
sed -i.bak "s/^\$checksum64 = '.*'/\$checksum64 = '${checksum64}'/" tools/chocolateyInstall.ps1