From: Steve Hancock Date: Sun, 5 Feb 2023 00:39:00 +0000 (-0800) Subject: avoid possibility of starting a random run twice X-Git-Tag: 20230309~41 X-Git-Url: https://git.donarmstrong.com/?a=commitdiff_plain;h=6d26fe71811ad3e5085db00a745337c878985bbd;p=perltidy.git avoid possibility of starting a random run twice 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. --- diff --git a/dev-bin/perltidy_random_run.pl b/dev-bin/perltidy_random_run.pl index bc82f732..b97852f3 100755 --- a/dev-bin/perltidy_random_run.pl +++ b/dev-bin/perltidy_random_run.pl @@ -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;