feature/clean-a-specific-scheme: Add this-scheme new flag for clean command (#116733)

Co-authored-by: Enguerrand_ARMINJON_MAC_2 <earminjon@sqli.com>
This commit is contained in:
Enguerrand ARMINJON
2023-02-21 18:35:13 +01:00
committed by GitHub
parent 902d86e09c
commit 6259b690f6
3 changed files with 90 additions and 5 deletions

View File

@@ -4,6 +4,7 @@
import 'dart:async';
import 'package:args/command_runner.dart';
import 'package:file/memory.dart';
import 'package:flutter_tools/src/base/common.dart';
import 'package:flutter_tools/src/base/context.dart';
@@ -103,6 +104,18 @@ Matcher throwsToolExit({ int? exitCode, Pattern? message }) {
/// Matcher for [ToolExit]s.
final TypeMatcher<ToolExit> _isToolExit = isA<ToolExit>();
/// Matcher for functions that throw [UsageException].
Matcher throwsUsageException({Pattern? message }) {
Matcher matcher = _isUsageException;
if (message != null) {
matcher = allOf(matcher, (UsageException e) => e.message.contains(message));
}
return throwsA(matcher);
}
/// Matcher for [UsageException]s.
final TypeMatcher<UsageException> _isUsageException = isA<UsageException>();
/// Matcher for functions that throw [ProcessException].
Matcher throwsProcessException({ Pattern? message }) {
Matcher matcher = _isProcessException;