Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func EvaluateEnv ¶
func EvaluateEnv(ctx context.Context, script []byte, args []string, envs []string) ([]string, error)
EvaluateEnv evaluates the environment variable script and returns the list of variables set in the script. Command execution is disabled along with redirection.
func GetEnv ¶
func GetEnv(hc interp.HandlerContext) []string
GetEnv returns an the list of all exported environment variables within the context of the shell interpreter.
Types ¶
type OpenHandler ¶
OpenHandler defines function prototype for shell interpreter file handler registration.
type Shell ¶
type Shell struct {
// contains filtered or unexported fields
}
Shell defines the shell interpreter.
func New ¶
func New(r io.Reader, name string, args []string, envs []string, runnerOptions ...interp.RunnerOption) (s *Shell, err error)
New returns a shell interpreter instance.
func (*Shell) LookPath ¶
LookPath returns the absolute path for the command passed in argument within the context of the shell interpreter.
func (*Shell) RegisterOpenHandler ¶
func (s *Shell) RegisterOpenHandler(path string, handler OpenHandler)
RegisterOpenHandler registers a shell interpreter file handler.
func (*Shell) RegisterShellBuiltin ¶
func (s *Shell) RegisterShellBuiltin(name string, builtin ShellBuiltin)
RegisterShellBuiltin registers a shell interpreter builtin.