From d5c13c4061ddd10ce37cf0ded203551c00304e07 Mon Sep 17 00:00:00 2001 From: NGPixel Date: Fri, 30 Jun 2017 16:41:51 -0400 Subject: [PATCH] fix: match 2 or 3 version precision for git --- server/configure.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/server/configure.js b/server/configure.js index 91ecaf95..a3d15b39 100644 --- a/server/configure.js +++ b/server/configure.js @@ -100,8 +100,8 @@ module.exports = (port, spinner) => { if (err || stdout.length < 3) { reject(new Error('Git is not installed or not reachable from PATH.')) } - let gitver = _.head(stdout.match(/[\d]+\.[\d]+\.[\d]+/g)) - if (!semver.satisfies(semver.clean(gitver), '>=2.7.4')) { + let gitver = _.head(stdout.match(/[\d]+\.[\d]+(\.[\d]+)?/gi)) + if (!gitver || !semver.satisfies(semver.clean(gitver), '>=2.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.')