Paket


CommandHelper

Namespace: Paket.Git

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

Nested types and modules

TypeDescription
ProcessResult

A process result including error code, message log and errors.

Functions and values

Function or valueDescription
directExec configProcessStartInfoF
Signature: configProcessStartInfoF:(ProcessStartInfo -> unit) -> bool

Runs the given process, waits for its completion and returns if it succeeded.

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

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

environVarOrNone name
Signature: name:string -> string option

Retrieves the environment variable or None

ExecProcessAndReturnMessages (...)
Signature: configProcessStartInfoF:(ProcessStartInfo -> unit) -> timeOut:TimeSpan -> ProcessResult

Runs the given process and returns the process result.

Parameters

  • configProcessStartInfoF - A function which overwrites the default ProcessStartInfo.
  • timeOut - The timeout for the process.
ExecProcessWithLambdas (...)
Signature: configProcessStartInfoF:(ProcessStartInfo -> unit) -> timeOut:TimeSpan -> silent:bool -> errorF:(string -> unit) -> messageF:(string -> unit) -> int

Runs the given process and returns the exit code.

Parameters

  • configProcessStartInfoF - A function which overwrites the default ProcessStartInfo.
  • timeOut - The timeout for the process.
  • silent - If this flag is set then the process output is redirected to the given output functions errorF and messageF.
  • errorF - A function which will be called with the error log.
  • messageF - A function which will be called with the message log.
fireAndForget configProcessStartInfoF
Signature: configProcessStartInfoF:(ProcessStartInfo -> unit) -> unit

Starts the given process and returns immediatly.

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".

gitTimeOut
Signature: TimeSpan

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

isValidPath path
Signature: path:string -> bool

Detects whether the given path does not contains invalid characters.

monoArguments
Signature: string

Arguments on the Mono executable

pathDirectories
Signature: seq<string>

Gets the list of valid directories included in the PATH environment variable.

platformInfoAction psi
Signature: psi:ProcessStartInfo -> unit

Modifies the ProcessStartInfo according to the platform semantics

runFullGitCommand repositoryDir command
Signature: repositoryDir:string -> command:string -> string []

Runs the git command and returns the results.

runGitCommand repositoryDir command
Signature: repositoryDir:string -> command:string -> bool * List<string> * 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.

separated delimiter items
Signature: delimiter:string -> items:seq<string> -> string

Converts a sequence of strings to a string with delimiters

splitEnvironVar name
Signature: name:string -> string list

Splits the entries of an environment variable and removes the empty ones.

toLines text
Signature: text:seq<string> -> string

Converts a sequence of strings into a string separated with line ends

tryFindFileOnPath file
Signature: file:string -> string option

Searches the current directory and the directories within the PATH environment variable for the given file. If successful returns the full path to the file.

Parameters

  • file - The file to locate
Fork me on GitHub