-
Notifications
You must be signed in to change notification settings - Fork 4
Tasks | Shell
Oleg edited this page May 6, 2017
·
1 revision
Requires version 0.10.x
Runs the shell (system) command.
Shell
task accepts settings of the ShellOptions type:
type ShellOptions = {
Command: string
Args: string seq
LogPrefix:string
StdOutLevel: string -> Level; ErrOutLevel: string -> Level
EnvVars: (string * string) list
WorkingDir: string option
/// Indicates command has to be executed under mono/.net runtime
UseClr: bool
FailOnErrorLevel: bool
}
Name | Default value | Description |
---|---|---|
Command | - | command to execute |
Args | - | arguments, list of strings |
StdOutLevel | fun _ -> Info | defined the output level for stdout output (called for each line) |
ErrOutLevel | fun _ -> Error | the same as above for stderr |
EnvVars | - | Allows to define environment variables for executed shell command |
WorkingDir | - | Sets the current directory |
UseClr | - | prefix the command with "mono" under linux |
FailOnErrorLevel | false | Instruct task to fail if command returned non-zero result |
Command is available via both common and simplified syntax:
open Xake.SystemTasks
...
do! Shell {ShellOptions.Default with
Command = "dir"; Args = ["*.*"]
WorkingDir = Some "."; UseClr = true; FailOnErrorLevel = true}
/// or simplified syntax:
let! error = shell {
cmd "dir"
args ["*.*"]
workdir "."
}
- Creating simple script
- Running the first build
- What the rule and recipe is?
- Filesets defined
- Editing the script
- Configure your project and CI
- Defining filesets
- Recipe computation
- Declaring the rules
- Error handling and exceptions
- Script and environment settings
- Command line interface (CLI)
- Writing cross-platform scripts
- Build-in functions
- .NET tasks
- System tasks
- Other
- ...