pub async fn run_script(
script_dir: &Path,
project_root: &Path,
modules_dir_name: &str,
manifest: &PackageJson,
script_name: &str,
script_cmd: &str,
extra_bin_dirs: &[&Path],
jail: Option<&ScriptJail>,
) -> Result<(), Error>Expand description
Run a single npm-style script line through sh -c with the usual
environment ($PATH extended with node_modules/.bin, INIT_CWD,
npm_lifecycle_event, npm_package_name, npm_package_version).
extra_bin_dirs are prepended to PATH in order, before the
project-level .bin. Dep lifecycle scripts pass the dep’s own
sibling node_modules/.bin/ so transitive binaries (e.g.
prebuild-install, node-gyp) declared in the dep’s
dependencies are reachable, optionally followed by aube-owned
tool dirs (e.g. the bootstrapped node-gyp). Root scripts pass
&[] — their transitive bins are already hoisted into the
project-level .bin.
Inherits stdio from the parent so the user sees script output live. Returns Err on non-zero exit so install fails fast if a lifecycle script breaks, matching pnpm.