In perl.git, the branch blead has been updated

<https://perl5.git.perl.org/perl.git/commitdiff/fbb64cf55d4ec47a6b340862d7902f06b7a1ddc8?hp=2407a17ad5d780a1625dddfb668056ab05459194>

- Log -----------------------------------------------------------------
commit fbb64cf55d4ec47a6b340862d7902f06b7a1ddc8
Author: Karl Williamson <k...@cpan.org>
Date:   Tue Apr 3 10:27:25 2018 -0600

    perlbug: Ask confirmation if would overwrite existing file
    
    This adds a prompt asking for confirmation if the perlbug report would
    overwrite an existing file. My guess is that the normal answer will be
    yes.

-----------------------------------------------------------------------

Summary of changes:
 utils/perlbug.PL | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/utils/perlbug.PL b/utils/perlbug.PL
index 3273902d0b..d1eb1e04a8 100644
--- a/utils/perlbug.PL
+++ b/utils/perlbug.PL
@@ -1122,6 +1122,10 @@ sub build_complete_message {
 sub save_message_to_disk {
     my $file = shift;
 
+        if (-e $file) {
+            my $response = _prompt( '', "Overwrite existing '$file'", 'n' );
+            return undef unless $response =~ / yes | y /xi;
+        }
         open OUTFILE, '>:raw', $file or do { warn  "Couldn't open '$file': 
$!\n"; return undef};
         binmode(OUTFILE, ':raw :crlf') if $Is_MSWin32;
 

-- 
Perl5 Master Repository

Reply via email to