Skip to main content

Module exec

Module exec 

Source
Expand description

Exec runtime: render the parsed Exec mini-language into shell text and run it through /bin/sh.

The pipeline AST itself is produced by crate::parse::exec; this module is concerned with turning typed request values into shell-safe words.

Semantics:

  • A ValueRef is resolved against an ExecContext (query/path/header/ var maps and a BodyValue).
  • A Text token is always emitted as one argv element. Missing interpolations render as the empty string.
  • A [..] Group token is used for shell words that contain interpolation. It is emitted only if every interpolation resolves; otherwise the whole group is omitted.
  • Request values interpolated into shell text are single-quoted. Literal shell syntax written by the spec author remains literal shell syntax.
  • A binary body used outside stdin is written to a temp file and the path is interpolated as a quoted shell word.
  • Pipeline stages are wired stdin → stdout. A bare Source stage ($ | cmd) feeds a value as stdin to the next command.

Structs§

ExecContext
ExecOutput

Enums§

BodyValue

Functions§

build_argv
preview_pipeline
Render a human-readable, non-executing preview of pipeline against ctx. Used by --dry-run to log the commands that would have run.
run_pipeline