version_bump/plugins/exec

The exec plugin — semantic-release’s escape hatch.

Instead of implementing a hook in Gleam, the user supplies a shell command for any lifecycle step via PluginSpec.options. Each option key maps to one hook; when present, that hook runs the command through sh -c in the project’s cwd:

Hook semantics:

Values

pub fn parse_release_type(
  stdout: String,
) -> option.Option(semver.ReleaseType)

Parse the trimmed stdout of an analyzeCommitsCmd into a ReleaseType.

PURE. Matches semantic-release/exec semantics: the command prints the bump type on stdout. "major"/"minor"/"patch" (case-insensitive, surrounding whitespace ignored) map to Some(..); empty output or any other value means “no release” (None).

pub fn plugin() -> plugin.Plugin

Build the exec plugin, wiring every hook to the command runner. Each hook looks up its corresponding option key at call time; if the key is absent the hook is a no-op (it returns the neutral value for that step), so a single plugin record can serve any subset of configured commands.

Search Document