From c3825b5aa1534b0b198894eda4db07dbdab2e604 Mon Sep 17 00:00:00 2001 From: ed Date: Thu, 30 Apr 2020 16:49:00 +0100 Subject: [PATCH] Projucer: Made the --tidy-whitespace command a bit more robust --- .../Source/Application/jucer_CommandLine.cpp | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/extras/Projucer/Source/Application/jucer_CommandLine.cpp b/extras/Projucer/Source/Application/jucer_CommandLine.cpp index c3b74c838f..8e5836e2e6 100644 --- a/extras/Projucer/Source/Application/jucer_CommandLine.cpp +++ b/extras/Projucer/Source/Application/jucer_CommandLine.cpp @@ -334,8 +334,14 @@ namespace { auto content = file.loadFileAsString(); - if (content.contains ("%""%") && content.contains ("//[")) - return; // ignore projucer GUI template files + auto isProjucerTemplateFile = [file, content] + { + return file.getFullPathName().contains ("Templates") + && content.contains ("%""%") && content.contains ("//["); + }(); + + if (isProjucerTemplateFile) + return; StringArray lines; lines.addLines (content); @@ -409,7 +415,7 @@ namespace files.add (target); for (int i = 0; i < files.size(); ++i) - cleanWhitespace (files.getReference(i), options); + cleanWhitespace (files.getReference (i), options); } }