Closed cowboyd closed 3 years ago
Latest commit: e67ba754713ac38e630ec2a1a396e51d121fccdd
The changes in this PR will be included in the next version bump.
Not sure what this means? Click here to learn what changesets are.
Click here if you're a maintainer who wants to add another changeset to this PR
Motivation
When installing ctrlc-windows on a non-windows platform, the
node-pre-gyp
invocation fails because a pre-compiled binary does not exist. This isn't much of a problem since the fallback behavior is to run thebuild.js
script which skips non-windows platforms entirely. In other words, the command is roughlyAnd it succeeds, so
yarn
does not bother you with the fact thatnode-pre-gyp
failed. However, when usingnpm
, not yarn, thestderr
is printed to the console always, even though the package install script succeeds overall. We want this warning to not be displayed with either package manager.Approach
This adds a
not-windows.js
script that exits successfully for all non-windows platforms that can be used to effectively "short-circuit" the install script if we're not running on windows. Not only does this silence the warning, but also has the added benefit thatnode-pre-gyp
is never invoked and so the network is never queried for the binaries that will never be found for non-windows systems.In other words, the package install script is now: