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 {

View File

@@ -9,7 +9,7 @@
"version": "0.2.4",
"license": "MIT",
"dependencies": {
"@pivotal-tools/jvm-launch-utils": "0.0.19",
"@pivotal-tools/jvm-launch-utils": "0.0.20",
"deep-equal": "^2.0.5",
"portfinder": "^1.0.28"
},
@@ -25,9 +25,9 @@
}
},
"node_modules/@pivotal-tools/jvm-launch-utils": {
"version": "0.0.19",
"resolved": "https://registry.npmjs.org/@pivotal-tools/jvm-launch-utils/-/jvm-launch-utils-0.0.19.tgz",
"integrity": "sha512-iPPJUYpqhWy7FCxh3uwcwIP1akMhNEpqtzeKQe9aWNJ+U85SykuxgY9ZzdBrysqiLZ0xSgoB4t/lTtsflyFY5A=="
"version": "0.0.20",
"resolved": "https://registry.npmjs.org/@pivotal-tools/jvm-launch-utils/-/jvm-launch-utils-0.0.20.tgz",
"integrity": "sha512-NjADvQGJRECRkNts2xUALwPj/KJkvCOkwkm+/v9pP6mKhVtMh2wABaeAggae4x7+hBNJH0V0mw60Y0kk/rbSpw=="
},
"node_modules/@types/node": {
"version": "16.11.11",
@@ -809,9 +809,9 @@
},
"dependencies": {
"@pivotal-tools/jvm-launch-utils": {
"version": "0.0.19",
"resolved": "https://registry.npmjs.org/@pivotal-tools/jvm-launch-utils/-/jvm-launch-utils-0.0.19.tgz",
"integrity": "sha512-iPPJUYpqhWy7FCxh3uwcwIP1akMhNEpqtzeKQe9aWNJ+U85SykuxgY9ZzdBrysqiLZ0xSgoB4t/lTtsflyFY5A=="
"version": "0.0.20",
"resolved": "https://registry.npmjs.org/@pivotal-tools/jvm-launch-utils/-/jvm-launch-utils-0.0.20.tgz",
"integrity": "sha512-NjADvQGJRECRkNts2xUALwPj/KJkvCOkwkm+/v9pP6mKhVtMh2wABaeAggae4x7+hBNJH0V0mw60Y0kk/rbSpw=="
},
"@types/node": {
"version": "16.11.11",

View File

@@ -24,7 +24,7 @@
"prepack": "tsc -p ./"
},
"dependencies": {
"@pivotal-tools/jvm-launch-utils": "0.0.19",
"@pivotal-tools/jvm-launch-utils": "0.0.20",
"deep-equal": "^2.0.5",
"portfinder": "^1.0.28"
},