Skip to content

Commit

Permalink
make reflog fail softly if no reflog obtained
Browse files Browse the repository at this point in the history
  • Loading branch information
finanalyst committed Feb 27, 2023
1 parent a12436b commit f833cb9
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion Website/plugins/git-reflog/add-ref-hash.raku
Expand Up @@ -4,10 +4,16 @@ sub ($source-cache, $mode-cache, Bool $full-render, $source-root, $mode-root, %
my $rep = $source-root.IO.parent;
my $proc = run <<git -C $rep rev-parse --short HEAD>>, :out;
my $reflog = $proc.out.slurp(:close).chomp;
if $reflog {
$reflog = '/tree/' ~ $reflog
}
else {
$reflog = ''
}
'reflog.raku'.IO.spurt(qq:to/TEMP/);
\%(
git-reflog => sub (\%prm, \%tml) \{
'\<p>from <a href="https://github.com/Raku/doc/tree/$reflog">github.com/Raku/doc/tree/$reflog\</a>\</p>'
'\<p>from <a href="https://github.com/Raku/doc$reflog">github.com/Raku/doc$reflog\</a>\</p>'
},
);
TEMP
Expand Down

0 comments on commit f833cb9

Please sign in to comment.