Skip to content

Commit e798ab3

Browse files
authored
Merge pull request #638 from baronfel/optional_dnc
allow for use of the FCS_DNC env flag to skip doing DNC build steps
2 parents 2637859 + 4c3901f commit e798ab3

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

build.fsx

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -222,7 +222,18 @@ Target "GitHubRelease" (fun _ ->
222222
// --------------------------------------------------------------------------------------
223223
// .NET Core and .NET Core SDK
224224

225-
let isDotnetSDKInstalled = (try Shell.Exec("dotnet", "--info") = 0 with _ -> false)
225+
let isDotnetSDKInstalled =
226+
match Fake.EnvironmentHelper.environVarOrNone "FCS_DNC" with
227+
| Some flag ->
228+
match bool.TryParse flag with
229+
| true, result -> result
230+
| _ -> false
231+
| None ->
232+
try
233+
Shell.Exec("dotnet", "--info") = 0
234+
with
235+
_ -> false
236+
226237
let assertExitCodeZero x = if x = 0 then () else failwithf "Command failed with exit code %i" x
227238
let runCmdIn workDir exe = Printf.ksprintf (fun args -> Shell.Exec(exe, args, workDir) |> assertExitCodeZero)
228239
let run exe = runCmdIn "." exe

0 commit comments

Comments
 (0)