From 232a40a5f1a49efd6b41e851564c8b7cd654299d Mon Sep 17 00:00:00 2001 From: XhmikosR Date: Tue, 8 Jun 2021 08:44:51 +0300 Subject: Improve vnu-jar.js (#34075) * switch to `execFile` for the java version command * simplify our ignores and removed no longer needed ones * remove `--no-langdetect` since it doesn't seem to trigger any issues any more --- build/vnu-jar.js | 20 +++++--------------- 1 file changed, 5 insertions(+), 15 deletions(-) (limited to 'build') diff --git a/build/vnu-jar.js b/build/vnu-jar.js index 7a912675e1..d031cc89be 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,23 +21,15 @@ 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