Skip to content

Commit

Permalink
fix call to ts compiler
Browse files Browse the repository at this point in the history
  • Loading branch information
yazeedobaid committed Apr 13, 2021
1 parent 44803ad commit d7eda49
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions src/app/Fake.JavaScript.TypeScript/TypeScript.fs
Original file line number Diff line number Diff line change
Expand Up @@ -152,16 +152,16 @@ module TypeScript =
Diagnostics.ProcessStartInfo(FileName = parameters.ToolPath, Arguments = arguments)
|> CreateProcess.ofStartInfo
|> CreateProcess.redirectOutput
|> CreateProcess.withTimeout parameters.TimeOut
|> Proc.run)
|> Seq.toList

let errors =
callResults
|> Seq.collect(fun x -> [x.Result.Error])

let hasErrors = errors |> Seq.isEmpty |> not
Seq.collect (fun x -> [x.Result.Output]) callResults |> Seq.iter Trace.trace
let hasErrors =
callResults
|> Seq.fold (fun acc result ->
match result.ExitCode = 0 with
| true -> Trace.trace result.Result.Output
| false -> Trace.traceError result.Result.Output
if result.ExitCode = 0 then acc else acc + 1) 0

if hasErrors then
Seq.iter Trace.traceError errors
if hasErrors > 0 then
failwith "TypeScript compiler encountered errors!"

0 comments on commit d7eda49

Please sign in to comment.