interp

package
v0.10.0 Latest Latest
Warning

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

Go to latest
Published: Nov 18, 2026 License: MIT Imports: 9 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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