Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Azure cli #9

Open
wants to merge 9 commits into
base: master
Choose a base branch
from
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
return the output
MohammdJawabreh committed May 17, 2021
commit df9c8fc96c594bd2d0a0fb34e9e8638e67dd2ccf
18 changes: 10 additions & 8 deletions src/app/Fake.Azure.Cli/Cli.fs
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
module Fake.Azure.Cli

module Fake.Azure.Cli

open System
open Fake.Core

type AzCommands =
| Account of string
| Acr of string
@@ -175,7 +175,7 @@ open Fake.Core
| Vmware of string
| Webapp of string

let parse = function
let private parse = function
| Account str -> sprintf "account %s" str
| Acr str -> sprintf "Acr %s" str
| Acs str -> sprintf "Acs %s" str
@@ -276,7 +276,7 @@ open Fake.Core
| LocalContext str -> sprintf "LocalContext %s" str
| Lock str -> sprintf "Lock %s" str
| Logic str -> sprintf "Logic %s" str
| Login str -> sprintf "Login %s" str
| Login str -> sprintf "Login %s" str
| Logout str -> sprintf "Logout %s" str
| Maintenance str -> sprintf "Maintenance %s" str
| Managedapp str -> sprintf "Managedapp %s" str
@@ -355,7 +355,6 @@ module AzCli =
"powershell", sprintf " az %s " commands
else
"az", commands
printfn "%s" args
args
|> Args.fromWindowsCommandLine
|> Seq.toList
@@ -364,11 +363,14 @@ module AzCli =
|> CreateProcess.withTimeout TimeSpan.MaxValue
|> Proc.run


/// Runs the given process and returns the process result.
let run command =
let args = command |> parse

let result = runPowerOrShRaw args
let result = runPowerOrShRaw args

result.ExitCode
match result.Result.Output with
| a when a = "[]" -> sprintf "\n Exit Code %d \n %s" result.ExitCode result.Result.Output
| _ -> sprintf "\n Exit Code %d \n %s" result.ExitCode result.Result.Error


2 changes: 1 addition & 1 deletion src/app/Fake.Azure.Cli/Fake.Azure.Cli.fsproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<OutputType>Exe</OutputType>
<OutputType>Library</OutputType>
<TargetFrameworks>netstandard2.0;net472</TargetFrameworks>
</PropertyGroup>