mirror of
https://github.com/bower/bower.git
synced 2026-02-12 15:05:05 -05:00
Check that git is installed when instantiating a git resolver
This commit is contained in:
@@ -7,9 +7,22 @@ var rimraf = require('rimraf');
|
||||
var mout = require('mout');
|
||||
var Resolver = require('./Resolver');
|
||||
var createError = require('../../util/createError');
|
||||
var which = require('which');
|
||||
|
||||
var gitChecked = false;
|
||||
|
||||
var GitResolver = function (source, options) {
|
||||
Resolver.call(this, source, options);
|
||||
|
||||
if (!gitChecked) {
|
||||
try {
|
||||
which.sync('git');
|
||||
} catch (ex) {
|
||||
throw new Error('git is not installed or not in the PATH');
|
||||
}
|
||||
}
|
||||
|
||||
gitChecked = true;
|
||||
};
|
||||
|
||||
util.inherits(GitResolver, Resolver);
|
||||
|
||||
Reference in New Issue
Block a user