Skip to content

Commit

Permalink
Make Greppable more forgiving
Browse files Browse the repository at this point in the history
So that windows newlines and other things work less horribly.
  • Loading branch information
AlexDaniel committed Jul 29, 2019
1 parent 8b040db commit 422f0d1
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions xbin/Greppable.p6
Expand Up @@ -73,7 +73,7 @@ sub process-grep-line($line, %commits) { # 🙈

take ~$repo # used for stats in PrettyLink
}
$text = shorten $text, 300; # do not print too long lines
$text = shorten $text || , 300; # do not print too long lines
$text = markdown-escape $text;
$text ~~ s:g/ “\c[ESC][1;31m” (.*?) [ “\c[ESC][m” | $ ] /<b>{$0}<\/b>/; # TODO get rid of \/ ?

Expand Down Expand Up @@ -103,7 +103,7 @@ multi method irc-to-me($msg) {
my %commits = ();
my $gist = | File | Code |\n|--|--|\n;
my $stats = gather {
$gist ~= $result<output>.split(\n).map({process-grep-line $_, %commits}).join: \n;
$gist ~= $result<output>.lines.map({process-grep-line $_, %commits}).join: \n;
}
my $total = $stats.elems;
my $modules = $stats.Set.elems;
Expand Down

0 comments on commit 422f0d1

Please sign in to comment.