]> git.donarmstrong.com Git - perltidy.git/commitdiff
avoid possibility of starting a random run twice
authorSteve Hancock <perltidy@users.sourceforge.net>
Sun, 5 Feb 2023 00:39:00 +0000 (16:39 -0800)
committerSteve Hancock <perltidy@users.sourceforge.net>
Sun, 5 Feb 2023 00:39:00 +0000 (16:39 -0800)
The GO.sh script is immediately moved to backup when a run starts.
That way it cannot be accidentally started again. Previously it was
moved to backup when a run ended.

dev-bin/perltidy_random_run.pl

index bc82f732a90ecff20150189a66e655548e51df83..b97852f3e2d21ab1353c4fdf546b1489ea864342 100755 (executable)
@@ -151,6 +151,14 @@ Requested range of profiles is $np_beg to $np_end
 EOM
 }
 
+# move any GO.sh to a backup to prevent accidentally running multiple copies
+my $runme = "GO.sh";
+if ( -e $runme ) {
+    my $bak = "$runme.bak";
+    if ( -e $bak ) { unlink $bak }
+    system("mv $runme $bak");
+}
+
 # Outer loop over files
 my $file_count = 0;
 my $case       = 0;