File tree Expand file tree Collapse file tree 2 files changed +5
-2
lines changed
pkgs/ffigen/lib/src/code_generator Expand file tree Collapse file tree 2 files changed +5
-2
lines changed Original file line number Diff line number Diff line change @@ -8,6 +8,7 @@ import 'package:logging/logging.dart';
8
8
import 'package:yaml_edit/yaml_edit.dart' ;
9
9
10
10
import '../code_generator.dart' ;
11
+ import '../code_generator/utils.dart' ;
11
12
import '../config_provider/config.dart' show Config;
12
13
import '../config_provider/config_types.dart' ;
13
14
@@ -96,7 +97,7 @@ class Library {
96
97
if (! file.existsSync ()) file.createSync (recursive: true );
97
98
file.writeAsStringSync (generate ());
98
99
if (format) {
99
- final result = Process .runSync (Platform .resolvedExecutable , [
100
+ final result = Process .runSync (dartExecutable , [
100
101
'format' ,
101
102
file.absolute.path,
102
103
], workingDirectory: file.parent.absolute.path);
Original file line number Diff line number Diff line change @@ -81,7 +81,9 @@ int fnvHash32(String input) {
81
81
/// This is usually just Platform.resolvedExecutable. But when running flutter
82
82
/// tests, the resolvedExecutable will be flutter_tester, and Dart will be in a
83
83
/// directory a few levels up from it.
84
- String findDart () {
84
+ final String dartExecutable = _findDart ();
85
+
86
+ String _findDart () {
85
87
var path = Platform .resolvedExecutable;
86
88
if (p.basenameWithoutExtension (path) == 'dart' ) return path;
87
89
final dartExe = 'dart${p .extension (path )}' ;
You can’t perform that action at this time.
0 commit comments