aboutsummaryrefslogtreecommitdiff
path: root/installer/install-fsautocomplete.sh
blob: 43827a47d53b160b52bd3752d7b5a88b540e2773 (plain)
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
#!/bin/bash

set -e

if command -v dotnet >/dev/null 2>&1; then
  echo "dotnet installed"
  dotnetcmd=dotnet
else
  echo "dotnet not found, installing..."
  # REF https://github.com/neovim/nvim-lsp/blob/master/lua/nvim_lsp/pyls_ms.lua
  curl -L https://dot.net/v1/dotnet-install.sh | bash -s -- -i "./.dotnet"
  dotnetcmd="\\$DIR/.dotnet/dotnet"
fi

url="https://ci.appveyor.com/api/projects/fsautocomplete/fsautocomplete/artifacts/bin/pkgs/fsautocomplete.netcore.zip?branch=master"
zip=fsautocomplete.zip
curl -L "$url" -o "$zip"
unzip -o -d "fsautocomplete.netcore" "$zip"
rm "$zip"

cat <<EOF >fsautocomplete
#!/bin/sh

DIR=\$(cd \$(dirname \$0); pwd)
$dotnetcmd \$DIR/fsautocomplete.netcore/fsautocomplete.dll
EOF

chmod +x fsautocomplete