From 0cf22e5ad89df2dffd4c7c099fb6195010c101dd Mon Sep 17 00:00:00 2001 From: Paul Lewis Date: Tue, 8 Sep 2020 17:13:39 +0100 Subject: [PATCH] [loc] Escape paths correctly The localization_utils check a list of excluded directories against the subdirectories of front_end. However, the list of directories hardcoded the / separator, which is incorrect on Windows. This led to localization checks in third_party subdirectories, causing build breakages and performance regressions. This CL updates the paths to use the node path.sep value, which in turn means that the string matching works on all\ platforms. R=tvanderlippe@chromium.org Change-Id: I5e1f2400b3f331ff4ac7acf953042b2ad900d40b Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2398827 Commit-Queue: Paul Lewis Auto-Submit: Paul Lewis Reviewed-by: Tim van der Lippe --- scripts/localization/utils/localization_utils.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/scripts/localization/utils/localization_utils.js b/scripts/localization/utils/localization_utils.js index 4e33ddf7cb..690f4ecb97 100644 --- a/scripts/localization/utils/localization_utils.js +++ b/scripts/localization/utils/localization_utils.js @@ -34,10 +34,10 @@ const excludeDirs = [ 'langpacks', 'node_modules', 'lighthouse_worker', - 'front_end/third_party', - 'front_end/dagre_layout', - 'front_end/javascript_metadata', - 'front_end/generated', + `front_end${path.sep}third_party`, + `front_end${path.sep}dagre_layout`, + `front_end${path.sep}javascript_metadata`, + `front_end${path.sep}generated`, ]; const cppSpecialCharactersMap = {