fix: match 2 or 3 version precision for git

This commit is contained in:
NGPixel 2017-06-30 16:41:51 -04:00 committed by Nicolas Giard
parent 6b37797a00
commit d5c13c4061

View File

@ -100,8 +100,8 @@ module.exports = (port, spinner) => {
if (err || stdout.length < 3) { if (err || stdout.length < 3) {
reject(new Error('Git is not installed or not reachable from PATH.')) reject(new Error('Git is not installed or not reachable from PATH.'))
} }
let gitver = _.head(stdout.match(/[\d]+\.[\d]+\.[\d]+/g)) let gitver = _.head(stdout.match(/[\d]+\.[\d]+(\.[\d]+)?/gi))
if (!semver.satisfies(semver.clean(gitver), '>=2.7.4')) { if (!gitver || !semver.satisfies(semver.clean(gitver), '>=2.7.4')) {
reject(new Error('Git version is too old. Minimum is v2.7.4.')) reject(new Error('Git version is too old. Minimum is v2.7.4.'))
} }
resolve('Git v' + gitver + ' detected. Minimum is v2.7.4.') resolve('Git v' + gitver + ' detected. Minimum is v2.7.4.')