exec

package
v0.1.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 25, 2026 License: MIT Imports: 6 Imported by: 0

Documentation

Overview

Package exec evaluates shell snippets. Each non-empty line of the entry file is treated as a single command and executed via "bash -c". The result echoes each command prefixed with "$ " followed by its raw combined output, mirroring an interactive shell session.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Evaluator

type Evaluator struct {
	// Shell is the shell binary used to run commands. Defaults to "bash".
	Shell string
}

Evaluator runs shell commands via "bash -c".

func New

func New() *Evaluator

New returns a shell evaluator using bash.

func (*Evaluator) Eval

func (e *Evaluator) Eval(ctx context.Context, req model.Request) (model.Result, error)

Eval reads req.Entry from req.FS and runs each non-empty line as a separate command. Command output (stdout and stderr combined) is returned as plain text, prefixed by the command that produced it.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL