Note: This is the migration API reference for FAKE 5. The new (modularized) API documentation can be found here. If the API is already migrated you can check here if exists in a module. More information regarding the migration can be found here

CommandHelper

Contains helpers which allow to interact with git via the command line.

Functions and values

Function or valueDescription
directRunGitCommand(...)
Signature: repositoryDir:string -> command:string -> bool

Runs the given git command, waits for its completion and returns whether it succeeded.

directRunGitCommandAndFail(...)
Signature: repositoryDir:string -> command:string -> unit

Runs the given git command, waits for its completion and fails when it didn't succeeded.

findGitDir(repositoryDir)
Signature: repositoryDir:string -> DirectoryInfo

Searches the .git directory recursivly up to the root.

fireAndForgetGitCommand(...)
Signature: repositoryDir:string -> command:string -> unit

Fires the given git command ind the given repository directory and returns immediatly.

gitCommand repositoryDir command
Signature: repositoryDir:string -> command:string -> unit

Runs the given git command, waits for its completion.

gitPath
Signature: string

Tries to locate the git.exe via the eviroment variable "GIT".

GitPath
Signature: string
gitTimeOut
Signature: TimeSpan

Specifies a global timeout for git.exe - default is no timeout

runGitCommand repositoryDir command
Signature: repositoryDir:string -> command:string -> bool * string list * string

Runs git.exe with the given command in the given repository directory.

runSimpleGitCommand(...)
Signature: repositoryDir:string -> command:string -> string

Runs the git command and returns the first line of the result.

setInfo(...)
Signature: gitPath:string -> repositoryDir:string -> command:string -> info:ProcStartInfo -> ProcStartInfo
showGitCommand repositoryDir command
Signature: repositoryDir:string -> command:string -> unit

Runs the given git command, waits for its completion. This version doesn't throw an exception if an error occurs. It just traces the error.