Unverified Commit 559d524e authored by Christopher Fujino's avatar Christopher Fujino Committed by GitHub

improve debugging when dart pub get call fails (#112968)

parent 2c0d43e7
...@@ -418,7 +418,10 @@ class _DefaultPub implements Pub { ...@@ -418,7 +418,10 @@ class _DefaultPub implements Pub {
status?.cancel(); status?.cancel();
if (exception is io.ProcessException) { if (exception is io.ProcessException) {
final StringBuffer buffer = StringBuffer('${exception.message}\n'); final StringBuffer buffer = StringBuffer('${exception.message}\n');
buffer.writeln('Working directory: "$directory"'); final String directoryExistsMessage = _fileSystem.directory(directory).existsSync()
? 'exists'
: 'does not exist';
buffer.writeln('Working directory: "$directory" ($directoryExistsMessage)');
final Map<String, String> env = await _createPubEnvironment(context, flutterRootOverride); final Map<String, String> env = await _createPubEnvironment(context, flutterRootOverride);
buffer.write(_stringifyPubEnv(env)); buffer.write(_stringifyPubEnv(env));
throw io.ProcessException( throw io.ProcessException(
......
...@@ -782,7 +782,7 @@ last line of pub output: "err3" ...@@ -782,7 +782,7 @@ last line of pub output: "err3"
isA<ProcessException>().having( isA<ProcessException>().having(
(ProcessException error) => error.message, (ProcessException error) => error.message,
'message', 'message',
contains('Working directory: "/"'), contains('Working directory: "/" (exists)'),
).having( ).having(
(ProcessException error) => error.message, (ProcessException error) => error.message,
'message', 'message',
......
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