@@ -140,12 +140,6 @@ class PubContext {
140
140
}
141
141
}
142
142
143
- enum PubOutputMode {
144
- none,
145
- standard,
146
- summaryOnly,
147
- }
148
-
149
143
/// A handle for interacting with the pub tool.
150
144
abstract class Pub {
151
145
/// Create a default [Pub] instance.
@@ -178,6 +172,10 @@ abstract class Pub {
178
172
/// If [shouldSkipThirdPartyGenerator] is true, the overall pub get will be
179
173
/// skipped if the package config file has a "generator" other than "pub".
180
174
/// Defaults to true.
175
+ ///
176
+ /// If [printProgress] is true, `pub get` will inherit stdio from the current process.
177
+ /// Defaults to true.
178
+ ///
181
179
/// Will also resolve dependencies in the example folder if present.
182
180
Future <void > get ({
183
181
required PubContext context,
@@ -187,7 +185,7 @@ abstract class Pub {
187
185
String ? flutterRootOverride,
188
186
bool checkUpToDate = false ,
189
187
bool shouldSkipThirdPartyGenerator = true ,
190
- PubOutputMode outputMode = PubOutputMode .standard
188
+ bool printProgress = true ,
191
189
});
192
190
193
191
/// Runs pub in 'batch' mode.
@@ -227,7 +225,7 @@ abstract class Pub {
227
225
required String command,
228
226
bool touchesPackageConfig = false ,
229
227
bool generateSyntheticPackage = false ,
230
- PubOutputMode outputMode = PubOutputMode .standard
228
+ bool printProgress = true ,
231
229
});
232
230
}
233
231
@@ -292,7 +290,7 @@ class _DefaultPub implements Pub {
292
290
String ? flutterRootOverride,
293
291
bool checkUpToDate = false ,
294
292
bool shouldSkipThirdPartyGenerator = true ,
295
- PubOutputMode outputMode = PubOutputMode .standard
293
+ bool printProgress = true ,
296
294
}) async {
297
295
final String directory = project.directory.path;
298
296
final File packageConfigFile = project.packageConfigFile;
@@ -364,7 +362,7 @@ class _DefaultPub implements Pub {
364
362
directory: directory,
365
363
failureMessage: 'pub $command failed' ,
366
364
flutterRootOverride: flutterRootOverride,
367
- outputMode : outputMode ,
365
+ printProgress : printProgress ,
368
366
);
369
367
await _updateVersionAndPackageConfig (project);
370
368
}
@@ -381,19 +379,19 @@ class _DefaultPub implements Pub {
381
379
Future <void > _runWithStdioInherited (
382
380
List <String > arguments, {
383
381
required String command,
384
- required PubOutputMode outputMode,
385
382
required PubContext context,
386
383
required String directory,
387
384
String failureMessage = 'pub failed' ,
388
385
String ? flutterRootOverride,
386
+ bool printProgress = true
389
387
}) async {
390
388
int exitCode;
391
389
392
390
final List <String > pubCommand = _pubCommand (arguments);
393
- final Map <String , String > pubEnvironment = await _createPubEnvironment (context: context, flutterRootOverride: flutterRootOverride, summaryOnly: outputMode == PubOutputMode .summaryOnly );
391
+ final Map <String , String > pubEnvironment = await _createPubEnvironment (context: context, flutterRootOverride: flutterRootOverride, summaryOnly: printProgress );
394
392
395
393
try {
396
- if (outputMode != PubOutputMode .none ) {
394
+ if (printProgress ) {
397
395
final io.Stdio ? stdio = _stdio;
398
396
if (stdio == null ) {
399
397
// Let pub inherit stdio and output directly to the tool's stdout and
@@ -564,14 +562,14 @@ class _DefaultPub implements Pub {
564
562
required String command,
565
563
bool touchesPackageConfig = false ,
566
564
bool generateSyntheticPackage = false ,
567
- PubOutputMode outputMode = PubOutputMode .standard
565
+ bool printProgress = true ,
568
566
}) async {
569
567
await _runWithStdioInherited (
570
568
arguments,
571
569
command: command,
572
570
directory: _fileSystem.currentDirectory.path,
573
571
context: context,
574
- outputMode : outputMode ,
572
+ printProgress : printProgress ,
575
573
);
576
574
if (touchesPackageConfig && project != null ) {
577
575
await _updateVersionAndPackageConfig (project);
0 commit comments