versions() fixed issue windows
This commit is contained in:
+21
-4
@@ -443,6 +443,7 @@ function versions(apps, callback) {
|
||||
};
|
||||
})();
|
||||
|
||||
let cmd = '';
|
||||
try {
|
||||
if ({}.hasOwnProperty.call(appsObj.versions, 'openssl')) {
|
||||
appsObj.versions.openssl = process.versions.openssl;
|
||||
@@ -465,7 +466,11 @@ function versions(apps, callback) {
|
||||
});
|
||||
}
|
||||
if ({}.hasOwnProperty.call(appsObj.versions, 'pm2')) {
|
||||
exec('pm2 -v', function (error, stdout) {
|
||||
cmd = 'pm2';
|
||||
if (_windows) {
|
||||
cmd += '.cmd';
|
||||
}
|
||||
exec(`${cmd} -v`, function (error, stdout) {
|
||||
if (!error) {
|
||||
let pm2 = stdout.toString().split('\n')[0].trim();
|
||||
if (!pm2.startsWith('[PM2]')) {
|
||||
@@ -484,7 +489,11 @@ function versions(apps, callback) {
|
||||
});
|
||||
}
|
||||
if ({}.hasOwnProperty.call(appsObj.versions, 'gulp')) {
|
||||
exec('gulp --version', function (error, stdout) {
|
||||
cmd = 'gulp';
|
||||
if (_windows) {
|
||||
cmd += '.cmd';
|
||||
}
|
||||
exec(`${cmd} --version`, function (error, stdout) {
|
||||
if (!error) {
|
||||
const gulp = stdout.toString().split('\n')[0] || '';
|
||||
appsObj.versions.gulp = (gulp.toLowerCase().split('version')[1] || '').trim();
|
||||
@@ -493,7 +502,11 @@ function versions(apps, callback) {
|
||||
});
|
||||
}
|
||||
if ({}.hasOwnProperty.call(appsObj.versions, 'tsc')) {
|
||||
exec('tsc --version', function (error, stdout) {
|
||||
cmd = 'tsc';
|
||||
if (_windows) {
|
||||
cmd += '.cmd';
|
||||
}
|
||||
exec(`${cmd} --version`, function (error, stdout) {
|
||||
if (!error) {
|
||||
const tsc = stdout.toString().split('\n')[0] || '';
|
||||
appsObj.versions.tsc = (tsc.toLowerCase().split('version')[1] || '').trim();
|
||||
@@ -502,7 +515,11 @@ function versions(apps, callback) {
|
||||
});
|
||||
}
|
||||
if ({}.hasOwnProperty.call(appsObj.versions, 'grunt')) {
|
||||
exec('grunt --version', function (error, stdout) {
|
||||
cmd = 'grunt';
|
||||
if (_windows) {
|
||||
cmd += '.cmd';
|
||||
}
|
||||
exec(`${cmd} --version`, function (error, stdout) {
|
||||
if (!error) {
|
||||
const grunt = stdout.toString().split('\n')[0] || '';
|
||||
appsObj.versions.grunt = (grunt.toLowerCase().split('cli v')[1] || '').trim();
|
||||
|
||||
Reference in New Issue
Block a user