Skip to content

Commit 82694c7

Browse files
FMorschelCommit Queue
authored andcommitted
[analyzer] Fixes dart path on Windows for DartFormat
Addresses TODO from https://dart-review.googlesource.com/c/sdk/+/448161. Change-Id: I2debc307a176deb7670e5681af9e712e25573eb1 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/448607 Auto-Submit: Felipe Morschel <[email protected]> Reviewed-by: Paul Berry <[email protected]> Reviewed-by: Samuel Rawlins <[email protected]> Commit-Queue: Samuel Rawlins <[email protected]>
1 parent 401c8bf commit 82694c7

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

pkg/analyzer_utilities/lib/tools.dart

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -245,9 +245,15 @@ class CodeGeneratorSettings {
245245

246246
/// A utility class for invoking 'dart format'.
247247
class DartFormat {
248-
static final String _dartPath =
249-
// TODO(paulberry): check that this is the right path on Windows.
250-
join(packageRoot, '..', 'tools', 'sdks', 'dart-sdk', 'bin', 'dart');
248+
static final String _dartPath = join(
249+
packageRoot,
250+
'..',
251+
'tools',
252+
'sdks',
253+
'dart-sdk',
254+
'bin',
255+
Platform.isWindows ? 'dart.exe' : 'dart',
256+
);
251257

252258
static void formatFile(File file) {
253259
var result = Process.runSync(_dartPath, ['format', file.path]);

0 commit comments

Comments
 (0)