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

This commit is contained in:
Christopher Fujino 2022-10-05 14:53:06 -07:00 committed by GitHub
parent 2c0d43e723
commit 559d524ec1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 2 deletions

View File

@ -418,7 +418,10 @@ class _DefaultPub implements Pub {
status?.cancel();
if (exception is io.ProcessException) {
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);
buffer.write(_stringifyPubEnv(env));
throw io.ProcessException(

View File

@ -782,7 +782,7 @@ last line of pub output: "err3"
isA<ProcessException>().having(
(ProcessException error) => error.message,
'message',
contains('Working directory: "/"'),
contains('Working directory: "/" (exists)'),
).having(
(ProcessException error) => error.message,
'message',