Skip to main content

Module hooks

Module hooks 

Source
Expand description

[[hooks]] runner - executes an app’s declared prebuild / prerun build/setup commands. See config::HookCfg for the schema. [[hooks]] runner: executes an app’s declared build/setup commands at the prebuild and prerun trigger points.

The schema and field reference live on crate::config::HookCfg; this module is the execution side: filtering by [HookCfg::when] and the current OS, skipping a hook whose declared outputs are already newer than its declared inputs, and running the rest in declaration order.

Callers (the lumenc CLI’s run / build / bundle commands) decide when to call [run_hooks]; lumenc check never does, so a check stays side-effect free.

Re-exports§

pub use crate::config::HookOs;
pub use crate::config::HookWhen;

Enums§

HookError
A [[hooks]] command failed.

Functions§

run_hooks
Run every hook in hooks whose when matches trigger and whose os (if set) matches std::env::consts::OS, in declaration order, with the child process’s cwd set to dir (the app directory). A hook whose declared outputs are all at least as new as its declared inputs is skipped; see [is_stale_free]. A hook that exits non-zero aborts the run immediately - later hooks do not run.