2017-04-04 22:26:40 +08:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
set -euo pipefail
|
|
|
|
|
2017-10-27 03:12:21 +08:00
|
|
|
cache_dir="$HOME/Library/Caches/Antlr4"
|
2017-11-14 17:47:33 +08:00
|
|
|
dotnet_url='https://download.microsoft.com/download/F/4/F/F4FCB6EC-5F05-4DF8-822C-FF013DF1B17F/dotnet-dev-osx-x64.1.1.4.pkg'
|
2017-10-27 03:12:21 +08:00
|
|
|
dotnet_file=$(basename "$dotnet_url")
|
2017-11-14 17:47:33 +08:00
|
|
|
dotnet_shasum='dc46d93716db8bea8cc3c668088cc9e39384b5a4'
|
2017-10-27 03:12:21 +08:00
|
|
|
|
2017-04-04 22:26:40 +08:00
|
|
|
thisdir=$(dirname "$0")
|
|
|
|
|
2017-09-29 06:40:35 +08:00
|
|
|
# OpenSSL setup for dotnet core
|
2017-04-04 22:26:40 +08:00
|
|
|
mkdir -p /usr/local/lib
|
|
|
|
ln -s /usr/local/opt/openssl/lib/libcrypto.1.0.0.dylib /usr/local/lib/
|
|
|
|
ln -s /usr/local/opt/openssl/lib/libssl.1.0.0.dylib /usr/local/lib/
|
|
|
|
|
|
|
|
# download dotnet core
|
2017-10-27 03:12:21 +08:00
|
|
|
mkdir -p "$cache_dir"
|
|
|
|
(cd "$cache_dir"
|
|
|
|
if [ -f "$dotnet_file" ]
|
|
|
|
then
|
|
|
|
if ! shasum -s -c <<<"$dotnet_shasum $dotnet_file"
|
|
|
|
then
|
|
|
|
rm -f "$dotnet_file"
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
if ! [ -f "$dotnet_file" ]
|
|
|
|
then
|
|
|
|
curl "$dotnet_url" -o "$dotnet_file"
|
|
|
|
fi
|
|
|
|
)
|
2017-04-04 22:26:40 +08:00
|
|
|
|
|
|
|
# install dotnet core
|
2017-10-27 03:12:21 +08:00
|
|
|
sudo installer -pkg "$cache_dir/$dotnet_file" -target /
|
2017-04-04 22:26:40 +08:00
|
|
|
|
|
|
|
# make the link
|
|
|
|
ln -s /usr/local/share/dotnet/dotnet /usr/local/bin/
|