Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix for issue #1355 : System.ArgumentNullException thrown for colored output #1362

Merged
merged 1 commit into from
Aug 22, 2016
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion src/app/FAKE/Program.fs
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@ let printEnvironment cmdArgs args =
traceFAKE "FSI-Path: %s" fsiPath
traceFAKE "MSBuild-Path: %s" msBuildExe

let hostBasedEnvArgs = seq { if isMono then yield "term", "xterm-256color" } // avoid problem with unsupported colored terminal output

let containsParam param = Seq.map toLower >> Seq.exists ((=) (toLower param))

let paramIsHelp param = containsParam param ["help"; "?"; "/?"; "-h"; "--help"; "/h"; "/help"]
Expand Down Expand Up @@ -87,6 +89,7 @@ try
yield! fakeArgs.GetResults <@ Cli.EnvVar @>
if fakeArgs.Contains <@ Cli.Single_Target @> then yield "single-target", "true"
if args.Target.IsSome then yield "target", args.Target.Value }
|> Seq.append hostBasedEnvArgs

//Get our fsiargs from somewhere!
let fsiArgs =
Expand Down Expand Up @@ -134,7 +137,7 @@ try
let buildScriptArg = if cmdArgs.Length > 1 && cmdArgs.[1].EndsWith ".fsx" then cmdArgs.[1] else Seq.head buildScripts
let fakeArgs = cmdArgs |> Array.filter (fun x -> x.StartsWith "-d:" = false)
let fsiArgs = cmdArgs |> Array.filter (fun x -> x.StartsWith "-d:") |> Array.toList
let args = CommandlineParams.parseArgs (fakeArgs |> Seq.filter ((<>) buildScriptArg) |> Seq.filter ((<>) "details"))
let args = Seq.toList hostBasedEnvArgs @ CommandlineParams.parseArgs (fakeArgs |> Seq.filter ((<>) buildScriptArg) |> Seq.filter ((<>) "details"))

traceStartBuild()
let printDetails = containsParam "details" cmdArgs
Expand Down