jira-precommit-hook
Advanced tools
Comparing version 2.1.1 to 2.1.2
@@ -15,2 +15,4 @@ 'use strict'; | ||
exports.isWorkEmail = isWorkEmail; | ||
var _chalk = require('chalk'); | ||
@@ -24,2 +26,7 @@ | ||
function isWorkEmail(email) { | ||
return (/@(extendhealth|towerswatson|willistowerswatson)\.com/i.test(email) | ||
); | ||
} | ||
exports.default = function () { | ||
@@ -41,3 +48,3 @@ var ref = (0, _asyncToGenerator3.default)(_regenerator2.default.mark(function _callee() { | ||
if (!/@(extendhealth|towerswatson|willistowerswatson)\.com/.test(email)) { | ||
if (!isWorkEmail(email)) { | ||
message = _chalk2.default.yellow('WARNING: The email address you have configured in Git, \'' + email + '\', is not ' + 'your work email address. To configure your work email address for this ' + 'repo run:\n\n') + _chalk2.default.green('> git config user.email "<Work Email Here>"') + _chalk2.default.yellow('\n\nTo configure your work email address for all repos run: (You may ' + 'want to remember to use your personal email address for any open source ' + 'repos with this option, so choose the option that works best for you.)\n\n') + _chalk2.default.green('> git config user.email "<Work Email Here>" --global\n'); | ||
@@ -62,4 +69,2 @@ | ||
return checkUserEmail; | ||
}(); | ||
module.exports = exports['default']; | ||
}(); |
{ | ||
"name": "jira-precommit-hook", | ||
"version": "2.1.1", | ||
"version": "2.1.2", | ||
"description": "Git commit hook to verify commit messages are tagged with a JIRA issue number", | ||
@@ -5,0 +5,0 @@ "main": "lib/index.js", |
59705
1302