01b714ac1398548d1e5a8534be25d6337268bfda7c08e6d84e1a801ed56797434239a5009ecbda44d5b2e5b231fca548c3e857d8073abc97391fd813632349 543 B

12345678910111213141516171819202122
  1. const {spawn} = require('child_process');
  2. const args = process.argv.slice(2);
  3. console.log(`Running ${args.join(' ')} on ${process.version}\n`);
  4. const match = /v(\d+)/.exec(process.version);
  5. const isHotfixNeeded = match && match[1] > 16;
  6. isHotfixNeeded && console.warn('Setting --openssl-legacy-provider as ssl hotfix');
  7. const test = spawn('cross-env',
  8. isHotfixNeeded ? ['NODE_OPTIONS=--openssl-legacy-provider', ...args] : args, {
  9. shell: true,
  10. stdio: 'inherit'
  11. }
  12. );
  13. test.on('exit', function (code) {
  14. process.exit(code)
  15. })