Unverified Commit 01a5d112 authored by Michael Thomsen's avatar Michael Thomsen Committed by GitHub

Make forward calls run interactively (#39052)

parent 5cd93ed9
...@@ -237,7 +237,7 @@ class PackagesForwardCommand extends FlutterCommand { ...@@ -237,7 +237,7 @@ class PackagesForwardCommand extends FlutterCommand {
@override @override
Future<FlutterCommandResult> runCommand() async { Future<FlutterCommandResult> runCommand() async {
Cache.releaseLockEarly(); Cache.releaseLockEarly();
await pub(<String>[_commandName, ...argResults.rest], context: PubContext.pubForward, retry: false); await pubInteractively(<String>[_commandName, ...argResults.rest]);
return null; return null;
} }
......
...@@ -396,10 +396,9 @@ void main() { ...@@ -396,10 +396,9 @@ void main() {
testUsingContext('deps', () async { testUsingContext('deps', () async {
await createTestCommandRunner(PackagesCommand()).run(<String>['packages', 'deps']); await createTestCommandRunner(PackagesCommand()).run(<String>['packages', 'deps']);
final List<String> commands = mockProcessManager.commands; final List<String> commands = mockProcessManager.commands;
expect(commands, hasLength(3)); expect(commands, hasLength(2));
expect(commands[0], matches(r'dart-sdk[\\/]bin[\\/]pub')); expect(commands[0], matches(r'dart-sdk[\\/]bin[\\/]pub'));
expect(commands[1], '--trace'); expect(commands[1], 'deps');
expect(commands[2], 'deps');
}, overrides: <Type, Generator>{ }, overrides: <Type, Generator>{
ProcessManager: () => mockProcessManager, ProcessManager: () => mockProcessManager,
Stdio: () => mockStdio, Stdio: () => mockStdio,
...@@ -409,10 +408,9 @@ void main() { ...@@ -409,10 +408,9 @@ void main() {
testUsingContext('cache', () async { testUsingContext('cache', () async {
await createTestCommandRunner(PackagesCommand()).run(<String>['packages', 'cache']); await createTestCommandRunner(PackagesCommand()).run(<String>['packages', 'cache']);
final List<String> commands = mockProcessManager.commands; final List<String> commands = mockProcessManager.commands;
expect(commands, hasLength(3)); expect(commands, hasLength(2));
expect(commands[0], matches(r'dart-sdk[\\/]bin[\\/]pub')); expect(commands[0], matches(r'dart-sdk[\\/]bin[\\/]pub'));
expect(commands[1], '--trace'); expect(commands[1], 'cache');
expect(commands[2], 'cache');
}, overrides: <Type, Generator>{ }, overrides: <Type, Generator>{
ProcessManager: () => mockProcessManager, ProcessManager: () => mockProcessManager,
Stdio: () => mockStdio, Stdio: () => mockStdio,
...@@ -422,10 +420,9 @@ void main() { ...@@ -422,10 +420,9 @@ void main() {
testUsingContext('version', () async { testUsingContext('version', () async {
await createTestCommandRunner(PackagesCommand()).run(<String>['packages', 'version']); await createTestCommandRunner(PackagesCommand()).run(<String>['packages', 'version']);
final List<String> commands = mockProcessManager.commands; final List<String> commands = mockProcessManager.commands;
expect(commands, hasLength(3)); expect(commands, hasLength(2));
expect(commands[0], matches(r'dart-sdk[\\/]bin[\\/]pub')); expect(commands[0], matches(r'dart-sdk[\\/]bin[\\/]pub'));
expect(commands[1], '--trace'); expect(commands[1], 'version');
expect(commands[2], 'version');
}, overrides: <Type, Generator>{ }, overrides: <Type, Generator>{
ProcessManager: () => mockProcessManager, ProcessManager: () => mockProcessManager,
Stdio: () => mockStdio, Stdio: () => mockStdio,
...@@ -435,10 +432,9 @@ void main() { ...@@ -435,10 +432,9 @@ void main() {
testUsingContext('uploader', () async { testUsingContext('uploader', () async {
await createTestCommandRunner(PackagesCommand()).run(<String>['packages', 'uploader']); await createTestCommandRunner(PackagesCommand()).run(<String>['packages', 'uploader']);
final List<String> commands = mockProcessManager.commands; final List<String> commands = mockProcessManager.commands;
expect(commands, hasLength(3)); expect(commands, hasLength(2));
expect(commands[0], matches(r'dart-sdk[\\/]bin[\\/]pub')); expect(commands[0], matches(r'dart-sdk[\\/]bin[\\/]pub'));
expect(commands[1], '--trace'); expect(commands[1], 'uploader');
expect(commands[2], 'uploader');
}, overrides: <Type, Generator>{ }, overrides: <Type, Generator>{
ProcessManager: () => mockProcessManager, ProcessManager: () => mockProcessManager,
Stdio: () => mockStdio, Stdio: () => mockStdio,
...@@ -448,11 +444,10 @@ void main() { ...@@ -448,11 +444,10 @@ void main() {
testUsingContext('global', () async { testUsingContext('global', () async {
await createTestCommandRunner(PackagesCommand()).run(<String>['packages', 'global', 'list']); await createTestCommandRunner(PackagesCommand()).run(<String>['packages', 'global', 'list']);
final List<String> commands = mockProcessManager.commands; final List<String> commands = mockProcessManager.commands;
expect(commands, hasLength(4)); expect(commands, hasLength(3));
expect(commands[0], matches(r'dart-sdk[\\/]bin[\\/]pub')); expect(commands[0], matches(r'dart-sdk[\\/]bin[\\/]pub'));
expect(commands[1], '--trace'); expect(commands[1], 'global');
expect(commands[2], 'global'); expect(commands[2], 'list');
expect(commands[3], 'list');
}, overrides: <Type, Generator>{ }, overrides: <Type, Generator>{
ProcessManager: () => mockProcessManager, ProcessManager: () => mockProcessManager,
Stdio: () => mockStdio, Stdio: () => mockStdio,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment