File tree Expand file tree Collapse file tree 3 files changed +20
-4
lines changed Expand file tree Collapse file tree 3 files changed +20
-4
lines changed Original file line number Diff line number Diff line change @@ -141,10 +141,11 @@ let private fsharpLintVersionOnPath () : (FSharpLintExecutableFile * FSharpLintV
141141 if File.Exists fsharpLint then Some fsharpLint
142142 else None)
143143 |> Seq.tryHead
144+ |> Option.bind File.From
144145
145146 fsharpLintExecutableOnPathOpt
146147 |> Option.bind ( fun fsharpLintExecutablePath ->
147- let processStart = ProcessStartInfo( fsharpLintExecutablePath)
148+ let processStart = ProcessStartInfo( File.Unwrap fsharpLintExecutablePath)
148149 processStart.Arguments <- " --version"
149150 processStart.RedirectStandardOutput <- true
150151 processStart.CreateNoWindow <- true
@@ -210,7 +211,7 @@ let createFor (startInfo: FSharpLintToolStartInfo) : Result<RunningFSharpLintToo
210211 ps.Arguments <- " --daemon"
211212 ps
212213 | FSharpLintToolStartInfo.ToolOnPath( FSharpLintExecutableFile executableFile) ->
213- let ps = ProcessStartInfo( executableFile)
214+ let ps = ProcessStartInfo( File.Unwrap executableFile)
214215 ps.Arguments <- " --daemon"
215216 ps
216217
Original file line number Diff line number Diff line change @@ -13,8 +13,18 @@ type FSharpLintResponseCode =
1313 | ErrDaemonCreationFailed = - 1
1414 | OkCurrentDaemonVersion = 0
1515
16+ type File = private File of string
17+ with
18+ static member From ( filePath : string ) =
19+ if File.Exists( filePath) then
20+ filePath |> File |> Some
21+ else
22+ None
23+
24+ static member Unwrap ( File f ) = f
25+
1626type FSharpLintVersion = FSharpLintVersion of string
17- type FSharpLintExecutableFile = FSharpLintExecutableFile of string
27+ type FSharpLintExecutableFile = FSharpLintExecutableFile of File
1828type Folder = private Folder of string
1929with
2030 static member from ( filePath : string ) =
Original file line number Diff line number Diff line change @@ -8,9 +8,14 @@ type FSharpLintResponseCode =
88 | ErrDaemonCreationFailed = - 1
99 | OkCurrentDaemonVersion = 0
1010
11+ type File = private File of string
12+ with
13+ static member From : string -> File option
14+ static member Unwrap : File -> string
15+
1116type FSharpLintVersion = FSharpLintVersion of string
1217
13- type FSharpLintExecutableFile = FSharpLintExecutableFile of string
18+ type FSharpLintExecutableFile = FSharpLintExecutableFile of File
1419
1520type Folder = private Folder of string
1621with
You can’t perform that action at this time.
0 commit comments