Skip to main content

run_root_script_by_name

Function run_root_script_by_name 

Source
pub async fn run_root_script_by_name(
    project_dir: &Path,
    modules_dir_name: &str,
    manifest: &PackageJson,
    name: &str,
) -> Result<bool, Error>
Expand description

Run a named root-package script if it’s defined. Used by commands (pack, publish, version) that need to run lifecycle hooks outside the install-focused LifecycleHook enum. Returns Ok(false) if the script isn’t defined.

The caller is responsible for gating on --ignore-scripts.