-
Notifications
You must be signed in to change notification settings - Fork 4.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Scripts: Add check-engines script to the package (#12721)
* Scripts: Add check-engines script to the package * Update packages/scripts/CHANGELOG.md Co-Authored-By: gziolo <grzegorz@gziolo.pl> * Update packages/scripts/README.md Co-Authored-By: gziolo <grzegorz@gziolo.pl> * Update minimal node version to 10.x Co-Authored-By: gziolo <grzegorz@gziolo.pl>
- Loading branch information
1 parent
3c1e5a2
commit 62b6250
Showing
6 changed files
with
62 additions
and
6 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
/** | ||
* External dependencies | ||
*/ | ||
const { sync: spawn } = require( 'cross-spawn' ); | ||
const { sync: resolveBin } = require( 'resolve-bin' ); | ||
|
||
/** | ||
* Internal dependencies | ||
*/ | ||
const { | ||
getCliArgs, | ||
hasCliArg, | ||
} = require( '../utils' ); | ||
|
||
const args = getCliArgs(); | ||
|
||
const hasConfig = hasCliArg( '--package' ) || | ||
hasCliArg( '--node' ) || | ||
hasCliArg( '--npm' ) || | ||
hasCliArg( '--yarn' ); | ||
const config = ! hasConfig ? | ||
[ | ||
'--node', '>=10.0.0', | ||
'--npm', '>=6.0.0', | ||
] : | ||
[]; | ||
|
||
const result = spawn( | ||
resolveBin( 'check-node-version' ), | ||
[ ...config, ...args ], | ||
{ stdio: 'inherit' } | ||
); | ||
|
||
process.exit( result.status ); |