git-authors-cli
Advanced tools
Comparing version 1.0.50 to 1.0.51
@@ -13,12 +13,12 @@ 'use strict' | ||
Options | ||
${gray('--')}cwd ${gray( | ||
'Specify the path for running the command (defaults to process.cwd())' | ||
${gray('--')}cwd ${gray('Specify the path for running the command (defaults to process.cwd())')} | ||
${gray('--')}ignore-pattern ${gray( | ||
'Skip authors if their name or email match pattern (allow multiple)' | ||
)} | ||
${gray('--')}save ${gray( | ||
${gray('--')}print ${gray( | ||
'Show information from the terminal, also `print=verbose` to show more information. (defaults to true)' | ||
)} | ||
${gray('--')}save ${gray( | ||
'Write contributors into package.json if it exists (defaults to true)' | ||
)} | ||
${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)' | ||
)} | ||
@@ -25,0 +25,0 @@ Examples |
@@ -27,3 +27,3 @@ #!/usr/bin/env node | ||
cwd: process.cwd(), | ||
print: true, | ||
print: '', | ||
save: true, | ||
@@ -34,2 +34,4 @@ ignorePattern: [] | ||
if (flags.print === '') flags.print = true | ||
const loadPkg = path => { | ||
@@ -54,2 +56,15 @@ try { | ||
const renderContributorsVerbose = (contributors, maxIndent) => { | ||
const maxIndexIndent = String(contributors.length).length | ||
console.log() | ||
contributors.forEach(({ author, commits, name }, index) => { | ||
const prettyAuthor = colors.gray(author.replace(name, colors.white(name))) | ||
const prettyCommits = colors.white(`${indent(maxIndent, commits)}${commits}`) | ||
const humanIndex = index + 1 | ||
const prettyIndex = colors.gray(`${indent(maxIndexIndent, humanIndex)}${humanIndex}`) | ||
console.log(` ${prettyIndex} ${prettyCommits} ${prettyAuthor}`) | ||
}) | ||
} | ||
const renderContributors = (contributors, maxIndent) => { | ||
@@ -140,3 +155,8 @@ console.log() | ||
if (contributors.length) { | ||
if (print) renderContributors(contributors, maxIndent) | ||
if (print) { | ||
(print === 'verbose' ? renderContributorsVerbose : renderContributors)( | ||
contributors, | ||
maxIndent | ||
) | ||
} | ||
const pkg = await loadPkg(pkgPath) | ||
@@ -143,0 +163,0 @@ |
@@ -5,3 +5,3 @@ { | ||
"homepage": "https://github.com/Kikobeats/git-authors-cli", | ||
"version": "1.0.50", | ||
"version": "1.0.51", | ||
"bin": { | ||
@@ -8,0 +8,0 @@ "git-authors": "bin/index.js", |
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
12532
176