git-authors-cli
Advanced tools
Comparing version 1.0.37 to 1.0.38
@@ -16,2 +16,3 @@ 'use strict' | ||
${gray('--')}print ${gray('Show information from the terminal (defaults to true)')} | ||
${gray('--')}ignore-pattern ${gray('Skip authors if their name or email match pattern (allow multiple)')} | ||
@@ -22,2 +23,4 @@ Examples | ||
'# Get contributors for a specific path project.' | ||
)}`) | ||
)} | ||
${gray('$')} git-authors-cli --ignore-pattern noreply.github.com ${gray('# Ignore github public surrogate emails.')} | ||
`) |
@@ -50,2 +50,6 @@ #!/usr/bin/env node | ||
default: true | ||
}, | ||
ignorePattern: { | ||
type: 'string', | ||
isMultiple: true, | ||
} | ||
@@ -107,3 +111,3 @@ } | ||
const { print, cwd, save } = cli.flags | ||
const { print, cwd, save, ignorePattern } = cli.flags | ||
const pkgPath = path.join(cwd, 'package.json') | ||
@@ -116,2 +120,3 @@ const cmd = `git shortlog -sne < ${TTY}` | ||
const { author: pkgAuthor = {} } = require(pkgPath) | ||
const ignorePatternReg = (ignorePattern.length === 0) ? undefined : new RegExp(`(${ignorePattern.join('|')})`,'i'); | ||
@@ -140,2 +145,3 @@ const contributors = extractContributors(stdout) | ||
.filter(({ email }) => emailRegex().test(email)) | ||
.filter(({ author }) => !(ignorePatternReg && ignorePatternReg.test(author))) | ||
.sort((c1, c2) => c2.commits - c1.commits) | ||
@@ -142,0 +148,0 @@ |
@@ -5,3 +5,3 @@ { | ||
"homepage": "https://nicedoc.io/Kikobeats/git-authors-cli", | ||
"version": "1.0.37", | ||
"version": "1.0.38", | ||
"bin": { | ||
@@ -8,0 +8,0 @@ "git-authors": "bin/index.js", |
@@ -32,2 +32,3 @@ # git-authors-cli | ||
--print Show information from the terminal (defaults to true) | ||
--ignore-pattern Skip authors if their name or email match pattern (allow multiple) | ||
@@ -37,2 +38,3 @@ Examples | ||
$ git-authors-cli ~/Projects/metascraper # Get contributors for a specific path project. | ||
$ git-authors-cli --ignore-pattern noreply.github.com # Ignore github public surrogate emails. | ||
``` | ||
@@ -39,0 +41,0 @@ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
11590
158
46