From ec986fcb57b4c37430d80b5a06ca82d0bee8eb74 Mon Sep 17 00:00:00 2001 From: XhmikosR Date: Tue, 22 Jun 2021 12:52:10 +0300 Subject: [PATCH] Manually backport #34075 and #34279 Improve and clean up vnu-jar.js --- build/vnu-jar.js | 17 ++++------------- 1 file changed, 4 insertions(+), 13 deletions(-) diff --git a/build/vnu-jar.js b/build/vnu-jar.js index 48ef364345..270f7c575b 100644 --- a/build/vnu-jar.js +++ b/build/vnu-jar.js @@ -9,10 +9,10 @@ 'use strict' -const childProcess = require('child_process') +const { execFile, spawn } = require('child_process') const vnu = require('vnu-jar') -childProcess.exec('java -version', (error, stdout, stderr) => { +execFile('java', ['-version'], (error, stdout, stderr) => { if (error) { console.error('Skipping vnu-jar test; Java is missing.') return @@ -21,19 +21,12 @@ childProcess.exec('java -version', (error, stdout, stderr) => { const is32bitJava = !/64-Bit/.test(stderr) // vnu-jar accepts multiple ignores joined with a `|`. - // Also note that the ignores are regular expressions. + // Also note that the ignores are string regular expressions. const ignores = [ // "autocomplete" is included in