interp

package
v0.6.0 Latest Latest
Warning

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

Go to latest
Published: Aug 26, 2026 License: MIT Imports: 8 Imported by: 0

Documentation

Overview

Package interp runs python/node/custom (and `set shell`-override) task bodies by writing the interpolated body to a temp file and exec-ing the configured interpreter against it (the just shebang/[script] model). No language runtimes are embedded (Principle V). A missing interpreter is an actionable error.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Run

func Run(ctx context.Context, taskName, script string, command []string, span token.Span, opts Options) error

Run writes script to a temp file and execs command against it, streaming I/O.

Types

type ExecError

type ExecError struct {
	Task string
	Name string
	Code int
	Span token.Span
	Err  error
}

ExecError reports a non-zero interpreter exit.

func (*ExecError) Error

func (e *ExecError) Error() string

func (*ExecError) Unwrap

func (e *ExecError) Unwrap() error

type MissingInterpreterError

type MissingInterpreterError struct {
	Task string
	Name string
	Err  error
}

MissingInterpreterError reports that the configured interpreter is not on PATH.

func (*MissingInterpreterError) Error

func (e *MissingInterpreterError) Error() string

type Options

type Options struct {
	Stdin  io.Reader
	Stdout io.Writer
	Stderr io.Writer
	Dir    string
	Env    []string
}

Options configures an interpreter run.

Jump to

Keyboard shortcuts

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