diff --git a/packages/flutter_tools/lib/src/dart/pub.dart b/packages/flutter_tools/lib/src/dart/pub.dart index f64249d083..7072661a5f 100644 --- a/packages/flutter_tools/lib/src/dart/pub.dart +++ b/packages/flutter_tools/lib/src/dart/pub.dart @@ -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 env = await _createPubEnvironment(context, flutterRootOverride); buffer.write(_stringifyPubEnv(env)); throw io.ProcessException( diff --git a/packages/flutter_tools/test/general.shard/dart/pub_get_test.dart b/packages/flutter_tools/test/general.shard/dart/pub_get_test.dart index 417185d141..e0db44ad04 100644 --- a/packages/flutter_tools/test/general.shard/dart/pub_get_test.dart +++ b/packages/flutter_tools/test/general.shard/dart/pub_get_test.dart @@ -782,7 +782,7 @@ last line of pub output: "err3" isA().having( (ProcessException error) => error.message, 'message', - contains('Working directory: "/"'), + contains('Working directory: "/" (exists)'), ).having( (ProcessException error) => error.message, 'message',