File tree Expand file tree Collapse file tree 3 files changed +23
-1
lines changed Expand file tree Collapse file tree 3 files changed +23
-1
lines changed Original file line number Diff line number Diff line change @@ -9,6 +9,10 @@ class FlutterGen {
9
9
FlutterGen (YamlMap flutterGenMap) {
10
10
if (flutterGenMap != null ) {
11
11
_output = safeCast <String >(flutterGenMap['output' ]);
12
+ if (_output != null && ! Directory (_output).existsSync ()) {
13
+ Directory (_output).createSync (recursive: true );
14
+ }
15
+
12
16
if (flutterGenMap.containsKey ('integrations' )) {
13
17
integrations = FlutterGenIntegrations (
14
18
safeCast <YamlMap >(flutterGenMap['integrations' ]));
Original file line number Diff line number Diff line change @@ -117,6 +117,24 @@ void main() {
117
117
);
118
118
});
119
119
120
+ test ('Change output path' , () async {
121
+ await FlutterGenerator (
122
+ File ('test_resources/pubspec_change_output_path.yaml' ))
123
+ .build ();
124
+ expect (
125
+ File ('test_resources/lib/aaa/bbb/ccc/assets.gen.dart' ).readAsStringSync (),
126
+ isNotEmpty,
127
+ );
128
+ expect (
129
+ File ('test_resources/lib/aaa/bbb/ccc/fonts.gen.dart' ).readAsStringSync (),
130
+ isNotEmpty,
131
+ );
132
+ expect (
133
+ File ('test_resources/lib/aaa/bbb/ccc/colors.gen.dart' ).readAsStringSync (),
134
+ isNotEmpty,
135
+ );
136
+ });
137
+
120
138
test ('Wrong output path' , () async {
121
139
await FlutterGenerator (
122
140
File ('test_resources/pubspec_wrong_output_path.yaml' ))
Original file line number Diff line number Diff line change 1
1
name : example
2
2
3
3
flutter_gen :
4
- output : null/null
4
+ output :
5
5
lineLength : 80
6
6
7
7
colors :
You can’t perform that action at this time.
0 commit comments