Documentation
¶
Overview ¶
Package scripting provides secure script and command execution with Azure context.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DefaultShell ¶
func DefaultShell() string
DefaultShell returns the platform-appropriate default shell.
func DetectShellFromFile ¶
DetectShellFromFile returns the appropriate shell for executing a script file based on its extension.
func IsSupportedShell ¶
IsSupportedShell returns whether the given shell name is a supported shell.
func ValidateShell ¶
ValidateShell checks whether shell is a known, supported shell name. An empty string is considered valid (auto-detect).
Types ¶
type Config ¶
type Config struct {
Shell string
Interactive bool
Args []string
// Env overrides the child process environment. When set, the child process
// receives exactly these variables instead of inheriting os.Environ().
// This prevents secrets from leaking into the parent process via os.Setenv.
Env []string
}
Config holds the configuration for script execution.
type ExecutionError ¶
ExecutionError indicates that script execution failed with a specific exit code.
func (*ExecutionError) Error ¶
func (e *ExecutionError) Error() string
type Executor ¶
type Executor struct {
// contains filtered or unexported fields
}
Executor executes scripts and commands with azd context.
func (*Executor) ExecuteDirect ¶
ExecuteDirect runs a command directly without shell wrapping, preserving exact argv semantics. This is the preferred mode for "run a program with azd env".
type InvalidShellError ¶
type InvalidShellError struct {
Shell string
}
InvalidShellError indicates that an invalid shell was specified.
func (*InvalidShellError) Error ¶
func (e *InvalidShellError) Error() string
type ScriptNotFoundError ¶
type ScriptNotFoundError struct {
Path string
}
ScriptNotFoundError indicates that a script file could not be found.
func (*ScriptNotFoundError) Error ¶
func (e *ScriptNotFoundError) Error() string
type ValidationError ¶
ValidationError indicates that input validation failed.
func (*ValidationError) Error ¶
func (e *ValidationError) Error() string