Skip to content

Commit 9ccd260

Browse files
authored
Merge pull request #40 from bakert/show-author-in-output
feat: include package author in output, but still don't add them to contributors
2 parents a64cb0b + d64d1c8 commit 9ccd260

File tree

1 file changed

+8
-7
lines changed

1 file changed

+8
-7
lines changed

bin/index.js

+8-7
Original file line numberDiff line numberDiff line change
@@ -132,11 +132,6 @@ const getContributors = async () => {
132132
return acc
133133
}, [])
134134
.filter(({ name }) => !REGEX_BOT_NAMES.test(name))
135-
.filter(({ email }) =>
136-
isString(pkgAuthor)
137-
? !new RegExp(pkgAuthor, 'i').test(email)
138-
: !isSameEmail(pkgAuthor.email, email)
139-
)
140135
.filter(({ email }) => emailRegex().test(email))
141136
.filter(({ author }) => !(ignorePatternReg && ignorePatternReg.test(author)))
142137
.sort(
@@ -150,15 +145,21 @@ const getContributors = async () => {
150145

151146
if (contributors.length) {
152147
if (print) {
153-
(print === 'verbose' ? renderContributorsVerbose : renderContributors)(
148+
;(print === 'verbose' ? renderContributorsVerbose : renderContributors)(
154149
contributors,
155150
maxIndent
156151
)
157152
}
158153
const pkg = await loadPkg(pkgPath)
159154

160155
if (pkg && save) {
161-
const newContributors = contributors.map(({ author }) => author)
156+
const newContributors = contributors
157+
.filter(({ email }) =>
158+
isString(pkgAuthor)
159+
? !new RegExp(pkgAuthor, 'i').test(email)
160+
: !isSameEmail(pkgAuthor.email, email)
161+
)
162+
.map(({ author }) => author)
162163
const newPkg = { ...pkg, contributors: newContributors }
163164
await jsonFuture.saveAsync(pkgPath, newPkg)
164165
if (print) {

0 commit comments

Comments
 (0)