2020-08-23 16:35:15 -04:00
|
|
|
"use strict";
|
|
|
|
|
|
|
|
const { major } = require("semver");
|
|
|
|
|
|
|
|
// This should be used like `node npm-skip-node8 || COMMAND`.
|
|
|
|
// - If node 8, this script returns true, skipping COMMAND
|
|
|
|
// - Otherwise, return false, running COMMAND
|
|
|
|
|
|
|
|
if (major(process.version) > 8) {
|
|
|
|
// Node >8; return "false" (wrt to shell scripting)
|
|
|
|
process.exit(1);
|
|
|
|
} else {
|
|
|
|
// Node 8; return "true" (wrt to shell scripting)
|
|
|
|
process.exit(0);
|
|
|
|
}
|
2020-09-21 01:14:06 -04:00
|
|
|
|