diff --git a/lib/generate/index.js b/lib/generate/index.js index 0b0311d..80c20b0 100644 --- a/lib/generate/index.js +++ b/lib/generate/index.js @@ -4,6 +4,14 @@ var _ = require('lodash/fp'); var formatBadge = require('./formatBadge'); var formatContributor = require('./formatContributor'); +function injectContentBetween(lines, content, startIndex, endIndex) { + return [].concat( + lines.slice(0, startIndex), + content, + lines.slice(endIndex) + ); +} + var injectBetweenTags = _.curry(function(tag, newContent, previousContent) { var lines = previousContent.split('\n'); var openingTagIndex = _.findIndex(_.startsWith('', '| Kent C. Dodds is awesome! | Kent C. Dodds is awesome! | Kent C. Dodds is awesome! | Kent C. Dodds is awesome! | Kent C. Dodds is awesome! |', - '| Kent C. Dodds is awesome! | Kent C. Dodds is awesome! |', '| :---: | :---: | :---: | :---: | :---: |', + '| Kent C. Dodds is awesome! | Kent C. Dodds is awesome! |', '', '', 'Thanks a lot guys!'