From 9d07c07f1f4eb85967d625cdc2f1c376fee76d3f Mon Sep 17 00:00:00 2001 From: Arnaud Legrand Date: Fri, 22 Mar 2019 14:19:10 +0100 Subject: [PATCH] Cosmetics --- bin/pandoc_fixer.pl | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/bin/pandoc_fixer.pl b/bin/pandoc_fixer.pl index 66c587b..6d80d55 100755 --- a/bin/pandoc_fixer.pl +++ b/bin/pandoc_fixer.pl @@ -7,7 +7,7 @@ my($usage) = "Usage: pandox_fixer.pl input.md"; my($input)=shift(@ARGV); ########### Git date ################# -my($gitdate)=`git log $input | grep Date | head -n 1`; +my($gitdate)=`git log --date=short $input | grep Date | head -n 1`; chomp($gitdate); $gitdate =~ s/Date: *//g; $gitdate =~ s/\s*\+.*$//g; @@ -43,12 +43,12 @@ open OUTPUT, "> ".$output or die; while(defined(my $line=)) { - if($line =~ /

AUTHOR:/) { next; } + if($line =~ /

/) { - if($input=~ /_fr.html/) { + if($output=~ /_fr.html/) { $line =~ s||Les sources de ce document sont disponibles sur gitlab.|g; $line .= "
Version du $gitdate.


\n" } else { @@ -72,3 +72,6 @@ while(defined(my $line=)) { print OUTPUT $line; } +close OUTPUT; +close INPUT; +unlink($output_temp); -- 2.18.1