From 6d26fe71811ad3e5085db00a745337c878985bbd Mon Sep 17 00:00:00 2001 From: Steve Hancock Date: Sat, 4 Feb 2023 16:39:00 -0800 Subject: [PATCH] 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. --- dev-bin/perltidy_random_run.pl | 8 ++++++++ 1 file changed, 8 insertions(+) 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; -- 2.39.5