aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorB. Watson <urchlay@slackware.uk>2023-06-22 15:35:59 -0400
committerB. Watson <urchlay@slackware.uk>2023-06-22 15:35:59 -0400
commit35ff1a391ba6b05af8cf20bfc3f5dd4e9fd50cec (patch)
tree7a297d520da2e2acd18664d507e123ed66f9619b
parentb43b7f91d93e0042c0f40e1b93b5cab035b9133e (diff)
downloadsbo-maintainer-tools-35ff1a391ba6b05af8cf20bfc3f5dd4e9fd50cec.tar.gz
sbolint: rename -a log file if it already exists.
-rwxr-xr-xsbolint5
1 files changed, 4 insertions, 1 deletions
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;
}