Skip to content

Commit

Permalink
[flutter_tools] print override storage warning to STDERR instead of S…
Browse files Browse the repository at this point in the history
…TDOUT (#106068)
  • Loading branch information
christopherfujino committed Jun 15, 2022
1 parent 261246b commit 589dd80
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 1 deletion.
2 changes: 1 addition & 1 deletion packages/flutter_tools/lib/src/cache.dart
Original file line number Diff line number Diff line change
Expand Up @@ -520,7 +520,7 @@ class Cache {
if (_hasWarnedAboutStorageOverride) {
return;
}
_logger.printStatus(
_logger.printError(
'Flutter assets will be downloaded from $overrideUrl. Make sure you trust this source!',
emphasis: true,
);
Expand Down
16 changes: 16 additions & 0 deletions packages/flutter_tools/test/general.shard/cache_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -319,6 +319,22 @@ void main() {

expect(() => cache.storageBaseUrl, throwsToolExit());
});

testWithoutContext('overridden storage base url prints warning to STDERR', () async {
final BufferLogger logger = BufferLogger.test();
const String baseUrl = 'https://storage.com';
final Cache cache = Cache.test(
platform: FakePlatform(environment: <String, String>{
'FLUTTER_STORAGE_BASE_URL': baseUrl,
}),
processManager: FakeProcessManager.any(),
logger: logger,
);

expect(cache.storageBaseUrl, baseUrl);
expect(logger.errorText, contains('Flutter assets will be downloaded from $baseUrl'));
expect(logger.statusText, isEmpty);
});
});

testWithoutContext('flattenNameSubdirs', () {
Expand Down

0 comments on commit 589dd80

Please sign in to comment.