| Index: pkg/front_end/lib/src/codegen/tools.dart
|
| diff --git a/pkg/front_end/lib/src/codegen/tools.dart b/pkg/front_end/lib/src/codegen/tools.dart
|
| index fbc2d45075b079bc3b1e5d12ae87e2952db51f81..fe2fca4af5ad279bd3519ab52399bbe2e41561a9 100644
|
| --- a/pkg/front_end/lib/src/codegen/tools.dart
|
| +++ b/pkg/front_end/lib/src/codegen/tools.dart
|
| @@ -238,7 +238,13 @@ class GeneratedFile extends GeneratedContent {
|
| class DartFormat {
|
| static String get _dartfmtPath {
|
| String binName = Platform.isWindows ? 'dartfmt.bat' : 'dartfmt';
|
| - return join(dirname(Platform.resolvedExecutable), binName);
|
| + for (var loc in [binName, join('dart-sdk', 'bin', binName)]) {
|
| + var candidatePath = join(dirname(Platform.resolvedExecutable), loc);
|
| + if (new File(candidatePath).existsSync()) {
|
| + return candidatePath;
|
| + }
|
| + }
|
| + throw new StateError('Could not find dartfmt executable');
|
| }
|
|
|
| static void formatFile(File file) {
|
|
|