Skip to content

Commit

Permalink
try alt dotnet cli call
Browse files Browse the repository at this point in the history
  • Loading branch information
cloudRoutine committed Dec 5, 2016
1 parent 1303693 commit eb4c1f2
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions build.fsx
Original file line number Diff line number Diff line change
Expand Up @@ -188,9 +188,24 @@ Target "Build" (fun _ ->
)


let assertExitCodeZero x =
if x = 0 then () else
failwithf "Command failed with exit code %i" x

let runCmdIn workDir exe =
Printf.ksprintf (fun args ->
Shell.Exec(exe, args, workDir) |> assertExitCodeZero)

/// Execute a dotnet cli command
let dotnet workDir = runCmdIn workDir "dotnet"

Target "DotnetRestore" (fun _ ->
netcoreFiles
|> Seq.iter (fun proj ->
let dir = Path.GetDirectoryName proj
dotnet dir "restore"


DotNetCli.Restore (fun c ->
{ c with
Project = proj
Expand All @@ -202,6 +217,10 @@ Target "DotnetRestore" (fun _ ->
Target "DotnetBuild" (fun _ ->
netcoreFiles
|> Seq.iter (fun proj ->
let dir = Path.GetDirectoryName proj
dotnet dir "build"


DotNetCli.Build (fun c ->
{ c with
Project = proj
Expand Down

0 comments on commit eb4c1f2

Please sign in to comment.