Skip to content

Commit

Permalink
Add feature to set limit in options for tags. Fixes github-tools#144
Browse files Browse the repository at this point in the history
  • Loading branch information
Alexander Vassbotn Røyne-Helgesen committed Mar 8, 2018
1 parent adfc5e5 commit 897d280
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion lib/src/Gren.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ class Gren {
token,
apiUrl,
tags,
limit,
ignoreLabels,
ignoreIssuesWith,
ignoreCommitsWith,
Expand All @@ -49,7 +50,14 @@ class Gren {
this.options.ignoreIssuesWith = utils.convertStringToArray(ignoreIssuesWith);
this.options.ignoreCommitsWith = utils.convertStringToArray(ignoreCommitsWith);
this.options.ignoreTagsWith = utils.convertStringToArray(ignoreTagsWith);
this.options.limit = this.options.tags.indexOf('all') >= 0 ? MAX_TAGS_LIMIT : TAGS_LIMIT;

if (limit && limit > 0 && limit <= MAX_TAGS_LIMIT) {
this.options.limit = limit;
} else if (this.options.tags.indexOf('all') >= 0) {
this.options.limit = MAX_TAGS_LIMIT;
} else {
this.options.limit = TAGS_LIMIT;
}

if (!token) {
throw chalk.red('You must provide the TOKEN');
Expand Down

0 comments on commit 897d280

Please sign in to comment.