@@ -74,15 +74,21 @@ main(List<String> arguments) async {
74
74
args['include' ] == null ? [] : args['include' ].split (',' );
75
75
76
76
String url = args['hosted-url' ];
77
- String footerFilePath = _resolveTildePath (args['footer' ]);
78
- if (footerFilePath != null && ! new File (footerFilePath).existsSync ()) {
79
- print ("Error: unable to locate the file with footer at ${footerFilePath }." );
80
- exit (1 );
77
+ List <String > footerFilePaths = args['footer' ].map (_resolveTildePath).toList ();
78
+ print (footerFilePaths);
79
+ for (String footerFilePath in footerFilePaths) {
80
+ if (! new File (footerFilePath).existsSync ()) {
81
+ print ("Error: unable to locate footer file: ${footerFilePath }." );
82
+ exit (1 );
83
+ }
81
84
}
82
- String headerFilePath = _resolveTildePath (args['header' ]);
83
- if (headerFilePath != null && ! new File (headerFilePath).existsSync ()) {
84
- print ("Error: unable to locate the file with header at ${headerFilePath }." );
85
- exit (1 );
85
+ List <String > headerFilePaths = args['header' ].map (_resolveTildePath).toList ();
86
+ print (headerFilePaths);
87
+ for (String headerFilePath in footerFilePaths) {
88
+ if (! new File (headerFilePath).existsSync ()) {
89
+ print ("Error: unable to locate header file: ${headerFilePath }." );
90
+ exit (1 );
91
+ }
86
92
}
87
93
88
94
Directory outputDir =
@@ -112,7 +118,7 @@ main(List<String> arguments) async {
112
118
print ('' );
113
119
114
120
var generators = await initGenerators (
115
- url, headerFilePath, footerFilePath , args['rel-canonical-prefix' ]);
121
+ url, headerFilePaths, footerFilePaths , args['rel-canonical-prefix' ]);
116
122
117
123
for (var generator in generators) {
118
124
generator.onFileCreated.listen (_onProgress);
@@ -163,7 +169,7 @@ ArgParser _createArgsParser() {
163
169
parser.addFlag ('version' ,
164
170
help: 'Display the version for $name .' , negatable: false );
165
171
parser.addFlag ('add-crossdart' ,
166
- help: 'Add Crossdart links to the source code pieces' ,
172
+ help: 'Add Crossdart links to the source code pieces. ' ,
167
173
negatable: false ,
168
174
defaultsTo: false );
169
175
parser.addOption ('dart-sdk' ,
@@ -181,11 +187,11 @@ ArgParser _createArgsParser() {
181
187
parser.addOption ('output' ,
182
188
help: 'Path to output directory.' , defaultsTo: defaultOutDir);
183
189
parser.addOption ('header' ,
184
- help :
185
- 'path to file containing HTML text, inserted into the header of every page .' );
190
+ allowMultiple : true ,
191
+ help : 'path to file containing HTML text.' );
186
192
parser.addOption ('footer' ,
187
- help :
188
- 'path to file containing HTML text, inserted into the footer of every page .' );
193
+ allowMultiple : true ,
194
+ help : 'path to file containing HTML text.' );
189
195
parser.addOption ('exclude' ,
190
196
help: 'Comma-separated list of library names to ignore.' );
191
197
parser.addOption ('include' ,
@@ -194,9 +200,9 @@ ArgParser _createArgsParser() {
194
200
help:
195
201
'URL where the docs will be hosted (used to generate the sitemap).' );
196
202
parser.addOption ('rel-canonical-prefix' ,
197
- help: 'If provided, add a rel="canonical" prefixed with provided value. '
203
+ help: 'If provided, add a rel="canonical" prefixed with provided value. \n '
198
204
'Consider using if building many versions of the docs for public SEO. '
199
- 'Learn more at https://goo.gl/gktN6F' );
205
+ 'Learn more at https://goo.gl/gktN6F. ' );
200
206
parser.addFlag ('include-source' ,
201
207
help: 'If source code blocks should be shown, if they exist.' ,
202
208
negatable: true ,
0 commit comments