mirror of
https://github.com/XploitWizer-Community/XploitSPY.git
synced 2025-01-11 23:45:36 +08:00
Fixed java issues
This commit is contained in:
parent
61b34d0c56
commit
2c87a7a512
@ -9,14 +9,14 @@ function javaversion(callback) {
|
|||||||
spawn.on('error', (err) => callback("Java Not Installed", null));
|
spawn.on('error', (err) => callback("Java Not Installed", null));
|
||||||
spawn.stderr.on('data', (data) => {
|
spawn.stderr.on('data', (data) => {
|
||||||
data = data.toString().split('\n')[0];
|
data = data.toString().split('\n')[0];
|
||||||
return callback(data, undefined)
|
// return callback(data, undefined)
|
||||||
var javaVersion = new RegExp('java version').test(data) ? data.split(' ')[2].replace(/"/g, '') : false;
|
var javaVersion = new RegExp('java version').test(data) ? data.split(' ')[2].replace(/"/g, '') : false;
|
||||||
var openJDKVersion = new RegExp('openjdk version').test(data) ? data.split(' ')[2].replace(/"/g, '') : false;
|
var openJDKVersion = new RegExp('openjdk version').test(data) ? data.split(' ')[2].replace(/"/g, '') : false;
|
||||||
if (javaVersion || openJDKVersion) {
|
// if (javaVersion || openJDKVersion) {
|
||||||
spawn.removeAllListeners();
|
spawn.removeAllListeners();
|
||||||
spawn.stderr.removeAllListeners();
|
spawn.stderr.removeAllListeners();
|
||||||
return callback(null, javaVersion);
|
return callback(null, "javaVersion"); // Bad idea but should work fine
|
||||||
} else return callback("Java Not Installed", undefined);
|
// } else return callback("Java Not Installed", undefined);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user