Module for building and executing commands or processes.
let step = Step.create "mStep" { do! Cmd.createWithArgs "dotnet" [ "build" ] |> Cmd.run let! result = Cmd.createWithArgs "dotnet" [ "gitversion" ] |> Cmd.result printfn "%s" result.Output.Std }
Type | Description |
Function or value | Description |
Full Usage:
argMaybe cond arg opts
Parameters:
bool
-
The condition.
arg : string
-
The argument to append.
opts : CmdOptions<'a>
-
The CmdOptions to append to.
Returns: CmdOptions<'a>
The updated CmdOptions.
|
|
Full Usage:
argOption arg opts
Parameters:
string option
-
The argument to append.
opts : CmdOptions<'a>
-
The CmdOptions to append to.
Returns: CmdOptions<'a>
The updated CmdOptions.
|
|
Full Usage:
argSecret arg opts
Parameters:
string
-
The argument to append.
opts : CmdOptions<'a>
-
The CmdOptions to append to.
Returns: CmdOptions<'a>
The updated CmdOptions.
|
**Appends** the given *secret* argument to the CmdOptions. Secret arguments are masked in console output.
|
Full Usage:
args args opts
Parameters:
string list
-
The arguments to append.
opts : CmdOptions<'a>
-
The CmdOptions to append to.
Returns: CmdOptions<'a>
The updated CmdOptions.
|
|
Full Usage:
argsMaybe cond args opts
Parameters:
bool
-
The condition.
args : string list
-
The arguments to append.
opts : CmdOptions<'a>
-
The CmdOptions to append to.
Returns: CmdOptions<'a>
The updated CmdOptions.
|
|
Full Usage:
argsOption args' opts
Parameters:
string list option
-
The arguments to append.
opts : CmdOptions<'a>
-
The CmdOptions to append to.
Returns: CmdOptions<'a>
The updated CmdOptions.
|
|
Full Usage:
checkExitCode check opts
Parameters:
ExitCodeCheckOption
-
The exit code check option.
opts : CmdOptions<'a>
-
The CmdOptions.
Returns: CmdOptions<'a>
The updated CmdOptions.
|
Sets the check exit code option on the CmdOptions. This sets if the exit code returned by the process should be checked. Check the options in ExitCodeCheckOption for more information on each option. The default is CheckCodeZero.
Example
let! output = Cmd.createWithArgs "dotnet" [ "build" ] |> Cmd.checkExitCode Cmd.CheckCodeNone |> Cmd.result |
Full Usage:
create cmd
Parameters:
string
-
The command to run.
Returns: CmdOptions<unit>
The new CmdOptions.
|
|
Full Usage:
createWithArgs cmd args
Parameters:
string
-
The command to run.
args : string list
-
A list of arguments to be passed to the command.
Returns: CmdOptions<unit>
The new CmdOptions.
|
Example
let cmd = Cmd.createWithArgs "dotnet" [ "build"; "--no-restore" ] |
Full Usage:
envVars envVars opts
Parameters:
(string * string) list
-
A key * value tuple list of environment variables to append.
opts : CmdOptions<'a>
-
The CmdOptions to append to.
Returns: CmdOptions<'a>
The updated CmdOptions.
|
Example
Cmd.createWithArgs "docker-compose" [ "build" ] |> Cmd.envVars [ ("DEBUG", "0"); ("TAG", "1.0.0") ] |
Full Usage:
prefix prefix opts
Parameters:
PrefixOption
-
The prefix option.
opts : CmdOptions<'a>
-
The CmdOptions.
Returns: CmdOptions<'a>
The updated CmdOptions.
|
Sets the prefix option on the CmdOptions. This sets if the console output will be prefixed with the step name.
|
Full Usage:
redirectOutput redirect opts
Parameters:
RedirectOption
-
The redirect option.
opts : CmdOptions<'a>
-
The CmdOptions.
Returns: CmdOptions<RedirectedOutput>
The updated CmdOptions.
|
Sets the redirect option on the CmdOptions. This controls how the output of the process should be redirected. Check the options in RedirectOption for more information on each option.
Example
let! output = Cmd.createWithArgs "dotnet" [ "build" ] |> Cmd.redirectOutput Cmd.RedirectToBoth |> Cmd.result |
Full Usage:
result opts ctx
Parameters:
CmdOptions<'a>
-
The CmdOptions.
ctx : MakeContext
-
The MakeContext of the current Make.
Returns: Result<ProcessResult<'a>, MakeError>
The result.
|
Runs a command/process with the specified options and returns a ProcessResult. The ProcessResult contains the exit code and optionally the redirected output if a redirect option was set. This method cannot be used if the output has not been redirected.
Example
let myStep = Step.create "myStep" { let! semverResult = Cmd.createWithArgs "dotnet" [ "gitversion"; "/showvariable"; "semver" ] |> Cmd.redirectOutput Cmd.Redirect |> Cmd.result let semver = semverResult.Output.Std } |
Full Usage:
run opts ctx
Parameters:
CmdOptions<'a>
-
The CmdOptions.
ctx : MakeContext
-
The MakeContext of the current Make.
Returns: Result<unit, MakeError>
The result.
|
Example
let build = Step.create "build" { do! Cmd.createWithArgs "dotnet" [ "build" ] |> Cmd.run } |
Full Usage:
timeout seconds opts
Parameters:
int
-
The timeout in seconds.
opts : CmdOptions<'a>
-
The CmdOptions.
Returns: CmdOptions<'a>
The updated CmdOptions.
|
Sets the timeout option on the CmdOptions. This is the time in seconds before the command times out and is terminated. The timeout being reached causes a step failure.
|
Full Usage:
workingDir path opts
Parameters:
string
-
The path of the working directory.
opts : CmdOptions<'a>
-
The CmdOptions.
Returns: CmdOptions<'a>
The updated CmdOptions.
|
|