This repository was archived by the owner on Aug 5, 2019. It is now read-only.
forked from fsharp/zarchive-vim-fsharp
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathinstall.fsx
55 lines (45 loc) · 1.99 KB
/
install.fsx
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
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
// include Fake lib
#r "packages/FAKE/tools/FakeLib.dll"
open Fake
open System
open System.IO
open System.Net
open System.Text.RegularExpressions
let homeVimPath =
if Environment.OSVersion.Platform = PlatformID.Unix || Environment.OSVersion.Platform = PlatformID.MacOSX then
Environment.GetEnvironmentVariable("HOME") @@ ".vim"
else Environment.ExpandEnvironmentVariables("%HOMEDRIVE%%HOMEPATH%") @@ "vimfiles"
let vimInstallDir = homeVimPath @@ "bundle/vim_fsharp_languageclient"
let vimBinDir = __SOURCE_DIRECTORY__ @@ "fsac"
let ftpluginDir = __SOURCE_DIRECTORY__ @@ "ftplugin"
let autoloadDir = __SOURCE_DIRECTORY__ @@ "autoload"
let syntaxDir = __SOURCE_DIRECTORY__ @@ "syntax"
let indentDir = __SOURCE_DIRECTORY__ @@ "indent"
let ftdetectDir = __SOURCE_DIRECTORY__ @@ "ftdetect"
let acArchive = "fsautocomplete.netcore.zip"
let acVersion = "master"
Target "FSharp.AutoComplete" (fun _ ->
CreateDir vimBinDir
use client = new WebClient()
Net.ServicePointManager.SecurityProtocol <- Net.SecurityProtocolType.Tls12
tracefn "Downloading version %s of FsAutoComplete" acVersion
client.DownloadFile(sprintf "https://ci.appveyor.com/api/projects/fsautocomplete/fsautocomplete/artifacts/bin/pkgs/%s?branch=%s" acArchive acVersion, vimBinDir @@ acArchive)
tracefn "Download complete"
tracefn "Unzipping"
Unzip vimBinDir (vimBinDir @@ acArchive))
Target "Install" (fun _ ->
DeleteDir vimInstallDir
CreateDir vimInstallDir
CopyDir (vimInstallDir @@ "fsac") vimBinDir (fun _ -> true)
CopyDir (vimInstallDir @@ "ftplugin") ftpluginDir (fun _ -> true)
CopyDir (vimInstallDir @@ "autoload") autoloadDir (fun _ -> true)
CopyDir (vimInstallDir @@ "syntax") syntaxDir (fun _ -> true)
CopyDir (vimInstallDir @@ "indent") indentDir (fun _ -> true)
CopyDir (vimInstallDir @@ "ftdetect") ftdetectDir (fun _ -> true))
Target "Clean" (fun _ ->
CleanDirs [ vimBinDir; vimInstallDir ])
Target "All" id
"FSharp.AutoComplete"
==> "Install"
==> "All"
RunTargetOrDefault "All"