Skip to content

Commit

Permalink
Merge pull request CompositionalIT#119 from forki/patch-3
Browse files Browse the repository at this point in the history
Report original output and split on linux and mac
  • Loading branch information
isaacabraham authored Apr 23, 2020
2 parents 6c376bf + 3814f3c commit d6ecb17
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/Farmer/Deploy.fs
Original file line number Diff line number Diff line change
Expand Up @@ -105,9 +105,9 @@ let listSubscriptions() = result {
}

let checkVersion minimum = result {
let! version = Az.version()
let! versionOutput = Az.version()
let! version =
version.Split([| "\r\n" |], StringSplitOptions.RemoveEmptyEntries)
versionOutput.Replace("\r\n","\n").Replace("\r","\n").Split([| "\n" |], StringSplitOptions.RemoveEmptyEntries)
|> Array.tryHead
|> Option.bind(fun text ->
match text.Split([| ' ' |], StringSplitOptions.RemoveEmptyEntries) with
Expand All @@ -119,7 +119,7 @@ let checkVersion minimum = result {
|> Option.bind(fun versionText ->
try Some(Version versionText)
with _ -> None)
|> Result.ofOption (sprintf "Unable to determine Azure CLI version. You need to have at least %O installed." minimum)
|> Result.ofOption (sprintf "Unable to determine Azure CLI version. You need to have at least %O installed. Output was: %s" minimum versionOutput)
return!
if version < minimum then Error (sprintf "You have %O of the Azure CLI installed, but the minimum version is %O. Please upgrade." version minimum)
else Ok version
Expand Down Expand Up @@ -168,4 +168,4 @@ let execute resourceGroupName parameters deployment = result {
printfn "All done, now parsing ARM response to get any outputs..."
let response = response |> JsonConvert.DeserializeObject<{| properties : {| outputs : Map<string, {| value : string |}> |} |}>
return response.properties.outputs |> Map.map (fun _ value -> value.value)
}
}

0 comments on commit d6ecb17

Please sign in to comment.