From 15b0db5f0190cb5180b17a4fe9dfedaeb5b4a620 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 24c862efe5..50469b6a24 100644 --- a/extras/Projucer/Source/Application/jucer_CommandLine.cpp +++ b/extras/Projucer/Source/Application/jucer_CommandLine.cpp @@ -346,8 +346,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); @@ -421,7 +427,7 @@ namespace files.add (target); for (int i = 0; i < files.size(); ++i) - cleanWhitespace (files.getReference(i), options); + cleanWhitespace (files.getReference (i), options); } }