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

@@ -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 {