From 35ff1a391ba6b05af8cf20bfc3f5dd4e9fd50cec Mon Sep 17 00:00:00 2001 From: "B. Watson" Date: Thu, 22 Jun 2023 15:35:59 -0400 Subject: sbolint: rename -a log file if it already exists. --- sbolint | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/sbolint b/sbolint index 55e5681..7d8de57 100755 --- a/sbolint +++ b/sbolint @@ -404,7 +404,10 @@ if($stdin) { if($recursive_git) { if(-t STDOUT) { chomp (my $outfile = "$SELF.log." . `date +%Y%m%d`); - warn "$SELF: stdout is a terminal, redirecting to $outfile"; + warn "$SELF: stdout is a terminal, redirecting to $outfile\n"; + if(rename $outfile, $outfile . ".old") { + warn "$SELF: renamed old $outfile to $outfile.old\n"; + } open my $f, ">$outfile" or die $!; *STDOUT = $f; } -- cgit v1.2.3