-
Notifications
You must be signed in to change notification settings - Fork 325
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Introduce custom templating * Remove console.logs and remove unused chalk * Indent js lines * Get the options from a different gren.json * Add the Templating system * Remove extra variable for config file * Simplify label templating * Use deep assign to merge the config file for templating * Add deep-assign to package.json * Update the readme file based on the templating system
- Loading branch information
1 parent
a4cca14
commit 5d50346
Showing
5 changed files
with
136 additions
and
32 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
'use strict'; | ||
|
||
function generate(placeholders, string) { | ||
return Object.keys(placeholders) | ||
.reduce(function(carry, placeholder) { | ||
var placeholderRegExp = new RegExp('{{' + placeholder + '}}', 'g'); | ||
|
||
return carry.replace(placeholderRegExp, placeholders[placeholder]); | ||
}, string); | ||
} | ||
|
||
module.exports = { | ||
generate: generate | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
{ | ||
"commit": "- {{message}}", | ||
"issue": "- {{labels}} {{name}} {{link}}", | ||
"issueInfo": { | ||
"labels": "{{labels}}", | ||
"label": "[**{{label}}**]", | ||
"name": "{{name}}", | ||
"link": "[{{text}}]({{url}})" | ||
}, | ||
"release": "## {{release}} {{date}}", | ||
"releaseInfo": { | ||
"release": "{{release}}", | ||
"date": "({{date}})" | ||
} | ||
} |