diff options
author | B. Watson <urchlay@slackware.uk> | 2023-06-22 15:35:59 -0400 |
---|---|---|
committer | B. Watson <urchlay@slackware.uk> | 2023-06-22 15:35:59 -0400 |
commit | 35ff1a391ba6b05af8cf20bfc3f5dd4e9fd50cec (patch) | |
tree | 7a297d520da2e2acd18664d507e123ed66f9619b | |
parent | b43b7f91d93e0042c0f40e1b93b5cab035b9133e (diff) | |
download | sbo-maintainer-tools-35ff1a391ba6b05af8cf20bfc3f5dd4e9fd50cec.tar.gz |
sbolint: rename -a log file if it already exists.
-rwxr-xr-x | sbolint | 5 |
1 files changed, 4 insertions, 1 deletions
@@ -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; } |