From 6d8ef051964ae2b507eaa290e0f2fb247575fd29 Mon Sep 17 00:00:00 2001 From: William Hesse Date: Wed, 23 Aug 2023 12:58:40 +0000 Subject: [PATCH] Fix generate_package_config script for Windows paths The change https://dart-review.googlesource.com/c/sdk/+/321722 does not handle a package path on Windows that uses backslashes. Add handling for this case. Bug: https://github.com/dart-lang/linter/issues/4411 Change-Id: I38fe39491ed60306dec1717b32f275c19ed0076b Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/322342 Reviewed-by: Jonas Termansen --- tools/generate_package_config.dart | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/generate_package_config.dart b/tools/generate_package_config.dart index ffe5323f8e8..b4ea33992d8 100644 --- a/tools/generate_package_config.dart +++ b/tools/generate_package_config.dart @@ -87,8 +87,8 @@ void main(List args) { if (p.name == name) p ]; if (name == 'linter' && matches.length > 1) { - final oldLinter = matches - .firstWhere((p) => p.rootUri.endsWith('third_party/pkg/linter')); + final oldLinter = matches.firstWhere((p) => + p.rootUri.replaceAll(r'\', '/').endsWith('third_party/pkg/linter')); packages.remove(oldLinter); matches.remove(oldLinter); }