]> git.donarmstrong.com Git - perltidy.git/commitdiff
a VERSION update turns off any DEVEL_MODE flags
authorSteve Hancock <perltidy@users.sourceforge.net>
Thu, 15 Oct 2020 13:40:19 +0000 (06:40 -0700)
committerSteve Hancock <perltidy@users.sourceforge.net>
Thu, 15 Oct 2020 13:40:19 +0000 (06:40 -0700)
dev-bin/build.pl

index 4d31bfd6b2d9e81a381bd9edfd2c56e4a8ca85a9..2e64741d158c623fe5120a7bfa57531880508c56 100755 (executable)
@@ -628,6 +628,15 @@ sub update_VERSION {
     my $is_pod_file = !$is_md_file && $source_file !~ /\.pm/;
     while ( my $line = <$fh> ) {
 
+        # Look for and turn off any DEVEL_MODE constants
+        if ( $line =~ /^\s*use constant DEVEL_MODE\s*=>\s*(\d);/ ) {
+            if ( $1 != 0 ) {
+                $line = <<EOM;
+use constant DEVEL_MODE => 0;
+EOM
+            }
+        }
+
         # finish writing after the change
         if ($old_VERSION_line) {
             $ftmp->print($line);