Skip to content

Commit

Permalink
Add prompt for task number and add time tracking when given
Browse files Browse the repository at this point in the history
  • Loading branch information
Spencerhutch committed Jan 15, 2019
1 parent 572afb5 commit 6ab3604
Showing 1 changed file with 13 additions and 4 deletions.
17 changes: 13 additions & 4 deletions engine.js
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,10 @@ module.exports = function (options) {
type: 'input',
name: 'body',
message: 'Provide a longer description of the change:\n'
}, {
type: 'input',
name: 'taskNumber',
message: 'Provide the task number of the current change ("ES-???"):\n'
}, {
type: 'input',
name: 'hours',
Expand All @@ -125,8 +129,8 @@ module.exports = function (options) {
choices: projects
}, {
when: function(response) {
return response.project === 'pricing-engine' ||
response.project === 'api-v2' ||
return response.project === 'pricing-engine' ||
response.project === 'api-v2' ||
response.project === 'data-warehousing-tracking'
},
type: 'list',
Expand All @@ -151,7 +155,7 @@ module.exports = function (options) {
};

// Hard limit this line
var head = (answers.type + ': ' + answers.subject.trim()).slice(0, maxLineWidth);
var head = (answers.type + '-' + answers.taskNumber + ': ' + answers.subject.trim()).slice(0, maxLineWidth);

// Wrap these lines at 100 characters
var body = wrap(answers.body, wrapOptions);
Expand All @@ -178,9 +182,14 @@ module.exports = function (options) {
sred = 'sred ' + [hours, project, subProject].join(' ')
}

var jiraTimeTracking = ''
if (hours || answers.taskNumber) {
jiraTimeTracking = '#time ' + hours + 'h'
}

var footer = wrap(answers.footer, wrapOptions);

commit([head, body, footer, sred].join('\n\n'));
commit([head, body, footer, sred, jiraTimeTracking].join('\n\n'));
});
}
};
Expand Down

0 comments on commit 6ab3604

Please sign in to comment.