We have to support 5 different cases with lifecycle scripts (prepare and prepublish) in node module based formulas. These are sorted by increasing difficulty / complexity to support:
- arbitrary download location with no
prepare(orprepublish) script: trivial to handle - npm registry tarball download (already prepared) with a
preparescript, which could be run a second time without failure: runningpreparetwice would be unnecessary but wouldn't break anything - npm registry tarball download (already prepared) with a
preparescript, which fails when run a second time (e.g. mkdir fails on already existing directory):--ignore-scriptsis required fornpm pack(and if we want this case to be rooted through the bundledDependencies branch for consistency we would need to pass--productionto the first localnpm install(because--ignore-scriptswon't work here, see npm background#1+4)) - source tarball downloads (not already prepared), but we don't want to run
prepare(e.g. fo