From 3814f3c9b45a0f5d77d76991dececa731dc84d4c Mon Sep 17 00:00:00 2001 From: Steffen Forkmann Date: Thu, 23 Apr 2020 22:00:54 +0200 Subject: [PATCH] Report original output and split on linux and mac --- src/Farmer/Deploy.fs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/Farmer/Deploy.fs b/src/Farmer/Deploy.fs index e055cee3b..2e94c1b9d 100644 --- a/src/Farmer/Deploy.fs +++ b/src/Farmer/Deploy.fs @@ -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 @@ -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 @@ -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 |} |}> return response.properties.outputs |> Map.map (fun _ value -> value.value) -} \ No newline at end of file +}