For testing ospec, we install a previous, known stable version as a dep-dependency as "ospec-stable". the postinstall hook is also used to rename the corresponding files in node_nodules/.bin from ospec* to ospec-stable* to avoid problems in Windows (where running ospec from npm scripts would try to load the ospec.js found at the root, rather than the corresponding shell script in node_nodules/.bin.
v4.1.2 tried to invoke the renaming script, but it wasn't part of the npm bundle, leading to an error when installing it as a dep. I couldn't find a way to execute JS conditionally from NPM scripts that works in both Windows and *nix, so I instead added the renaming script (~10loc) to the bundle. It is a noop when installed as a dep or dev-dep.
Motivation and Context
How Has This Been Tested?
Types of changes
[x] Bug fix (non-breaking change which fixes an issue)
[ ] New feature (non-breaking change which adds functionality)
[ ] Breaking change (fix or feature that would cause existing functionality to change)
[ ] Documentation change
Checklist:
[x] My code follows the code style of this project.
[ ] My change requires a change to the documentation.
[ ] I have updated the documentation accordingly.
[x] I have read all applicable contributing documents.
[x] I have added tests to cover my changes.
[x] All new and existing tests passed.
[x] I have updated the change log (if applicable).
Fix the post-install crash introduced in v4.1.2
Description
For testing
ospec
, we install a previous, known stable version as a dep-dependency as "ospec-stable". thepostinstall
hook is also used to rename the corresponding files innode_nodules/.bin
fromospec*
toospec-stable*
to avoid problems in Windows (where runningospec
from npm scripts would try to load theospec.js
found at the root, rather than the corresponding shell script innode_nodules/.bin
.v4.1.2
tried to invoke the renaming script, but it wasn't part of the npm bundle, leading to an error when installing it as a dep. I couldn't find a way to execute JS conditionally from NPM scripts that works in both Windows and *nix, so I instead added the renaming script (~10loc) to the bundle. It is a noop when installed as a dep or dev-dep.Motivation and Context
How Has This Been Tested?
Types of changes
Checklist: