schnee effeckt und fehler Korektur
This commit is contained in:
22
node_modules/bin-version/index.js
generated
vendored
22
node_modules/bin-version/index.js
generated
vendored
@@ -1,17 +1,15 @@
|
||||
'use strict';
|
||||
var childProcess = require('child_process');
|
||||
var findVersions = require('find-versions');
|
||||
const execa = require('execa');
|
||||
const findVersions = require('find-versions');
|
||||
|
||||
module.exports = function (bin, cb) {
|
||||
childProcess.exec(bin + ' --version', function (err, stdout, stderr) {
|
||||
if (err) {
|
||||
if (err.code === 'ENOENT') {
|
||||
err.message = 'Couldn\'t find the `' + bin + '` binary. Make sure it\'s installed and in your $PATH';
|
||||
module.exports = (binary, options = {}) => {
|
||||
return execa(binary, options.args || ['--version'])
|
||||
.then(result => findVersions(result.stdout || result.stderr, {loose: true})[0])
|
||||
.catch(error => {
|
||||
if (error.code === 'ENOENT') {
|
||||
error.message = `Couldn't find the \`${binary}\` binary. Make sure it's installed and in your $PATH.`;
|
||||
}
|
||||
|
||||
return cb(err);
|
||||
}
|
||||
|
||||
cb(null, findVersions(stdout.trim() || stderr.trim(), {loose: true})[0]);
|
||||
});
|
||||
throw error;
|
||||
});
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user