From 4a7a8fbef1220088cd1693bd274ec44620b4203e Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Wed, 8 Jan 2025 15:16:09 +0100 Subject: [PATCH] Bug 38664: The tidy script - fix race condition There was a race condition, edit_file trying to open it while it was not fully written by prettier (?) This is a dirty fix but it seems to do the trick. The error was: edit_file 'koha-tmpl/intranet-tmpl/prog/en/includes/cat-search.inc' - write_file: No such file or directory at misc/devel/tidy.pl line 149. Signed-off-by: Katrin Fischer --- misc/devel/tidy.pl | 2 ++ 1 file changed, 2 insertions(+) diff --git a/misc/devel/tidy.pl b/misc/devel/tidy.pl index 5809f7aebc..01f6799124 100755 --- a/misc/devel/tidy.pl +++ b/misc/devel/tidy.pl @@ -138,6 +138,8 @@ sub tidy_tt { run( command => sprintf q{yarn --silent run prettier --write %s}, $file ); if ($success) { + while ( !-f $file ) { sleep 1; } + # Revert the substitutions done by the prettier plugin edit_file sub { s###g;