Uh oh!
There was an error while loading. Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork 99
Expand file tree
/
Copy pathHelpers.fs
More file actions
Latest commit
34 lines (26 loc) · 918 Bytes
/
Copy pathHelpers.fs
File metadata and controls
34 lines (26 loc) · 918 Bytes
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
module Helpers
openBlackFox.Fake
openFake.Core
openFake.DotNet
letinitializeContext()=
letexecContext=
Context.FakeExecutionContext.Create false"build.fsx"[]
Context.setExecutionContext (Context.RuntimeContext.Fake execContext)
/// Executes a dotnet command in the given working directory
letrunDotNet cmd workingDir =
letresult=
DotNet.exec (DotNet.Options.withWorkingDirectory workingDir) cmd ""
if result.ExitCode <>0then
failwithf "'dotnet %s' failed in %s" cmd workingDir
letrunOrDefault defaultTarget args =
Trace.trace (sprintf "%A" args)
try
match args with
|[| target |]-> Target.runOrDefault target
| arr when args.Length >1-> Target.run 0(Array.head arr)(Array.tail arr |> List.ofArray)
|_-> BuildTask.runOrDefault defaultTarget
0
with
| e ->
printfn "%A" e
1