aboutsummaryrefslogtreecommitdiff
path: root/installer/install-fsautocomplete.sh
diff options
context:
space:
mode:
Diffstat (limited to 'installer/install-fsautocomplete.sh')
-rwxr-xr-xinstaller/install-fsautocomplete.sh27
1 files changed, 27 insertions, 0 deletions
diff --git a/installer/install-fsautocomplete.sh b/installer/install-fsautocomplete.sh
new file mode 100755
index 0000000..e19d2e8
--- /dev/null
+++ b/installer/install-fsautocomplete.sh
@@ -0,0 +1,27 @@
+#!/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"
+
+cat <<EOF >fsautocomplete
+#!/bin/sh
+
+DIR=\$(cd \$(dirname \$0); pwd)
+$dotnetcmd \$DIR/fsautocomplete.netcore/fsautocomplete.dll
+EOF
+
+chmod +x fsautocomplete