Use execFileSync instead of execSync

This commit is contained in:
BoykoAlex
2022-02-03 12:55:24 -05:00
parent 19809197c8
commit 0d28a120e7
5 changed files with 12 additions and 12 deletions

View File

@@ -1,12 +1,12 @@
{
"name": "@pivotal-tools/jvm-launch-utils",
"version": "0.0.19",
"version": "0.0.20",
"lockfileVersion": 2,
"requires": true,
"packages": {
"": {
"name": "@pivotal-tools/jvm-launch-utils",
"version": "0.0.19",
"version": "0.0.20",
"license": "MIT",
"devDependencies": {
"@types/node": "^16.6.0",

View File

@@ -1,6 +1,6 @@
{
"name": "@pivotal-tools/jvm-launch-utils",
"version": "0.0.19",
"version": "0.0.20",
"description": "Provides utilities useful for launching Java processes from node packages.",
"files": [
"src",

View File

@@ -182,7 +182,7 @@ class JVMImpl implements JVM {
}
isJdk(): boolean {
const javaExecutable = this.getJavaExecutable();
const str = ChildProcess.execSync(`"${javaExecutable}" --list-modules`, {windowsHide: true, encoding: 'utf8'});
const str = ChildProcess.execFileSync(javaExecutable, ['--list-modules'], {windowsHide: true, encoding: 'utf8'});
return str.search(/^jdk.management@.*$/m) >= 0;
}
jarLaunch(jar: string, vmargs?: [string], execFileOptions?: ChildProcess.ExecFileOptions): ChildProcess.ChildProcess {