Module shell_exec

Module shell_exec 

Source
Expand description

Cross-platform shell execution

Provides a unified interface for executing shell commands across platforms:

  • Unix: Uses sh -c (resolved via PATH)
  • Windows: Uses Git Bash (requires Git for Windows)

This enables hooks and commands to use the same bash syntax on all platforms. On Windows, Git for Windows must be installed — this is nearly universal among Windows developers since git itself is required.

Structs§

Cmd
Builder for executing commands with two modes of operation.
ShellConfig
Shell configuration for command execution

Constants§

DIRECTIVE_FILE_ENV_VAR
Environment variable removed from spawned subprocesses for security. Hooks and other child processes should not be able to write to the directive file.

Functions§

set_command_timeout
Set the command timeout for the current thread.
trace_instant
Emit an instant trace event (a milestone marker with no duration).