#! /usr/bin/env node

import chalk from 'chalk';
import console from 'console';

import gitAuthorStats from './git-author-stats';

gitAuthorStats().forEach((gitAuthorStat) => {
  const author = chalk.bold(gitAuthorStat.author);
  const commits = `${gitAuthorStat.commits} commits`;
  const added = chalk.green(`${gitAuthorStat.added} ++`);
  const removed = chalk.red(`${gitAuthorStat.removed} --`);

  const authorStats = [commits, added, removed].join(' / ');

  console.log(`${author}: ${authorStats}`);
});

@@ -22,21 +22,36 @@
 %0Aimport 
-chalk
+%7B bold, green, red %7D
  from 'c
@@ -197,86 +197,114 @@
 nst 
-author = chalk.bold(gitAuthorStat.author);%0A  const commits = %60$%7BgitAuthorStat.
+%7B%0A    author,%0A    commits,%0A    added,%0A    removed,%0A  %7D = gitAuthorStat;%0A%0A  const gitAuthorText = %5B%0A    %60$%7B
 comm
@@ -320,55 +320,23 @@
 its%60
-;%0A  const added = chalk.green(%60$%7BgitAuthorStat.
+,%0A    green(%60$%7B
 adde
@@ -346,117 +346,38 @@
 ++%60)
-;%0A  const removed = chalk.red(%60$%7BgitAuthorStat.removed%7D --%60);%0A%0A  const authorStats = %5Bcommits, added, removed
+,%0A    red(%60$%7Bremoved%7D --%60),%0A  
 %5D.jo
@@ -409,30 +409,38 @@
 (%60$%7B
+bold(
 author
+)
 %7D: $%7B
-a
+gitA
 uthor
-Stats
+Text
 %7D%60);

Refactor Git author text writing