Skip to content

Commit 589dd80

Browse files
[flutter_tools] print override storage warning to STDERR instead of STDOUT (#106068)
1 parent 261246b commit 589dd80

File tree

2 files changed

+17
-1
lines changed

2 files changed

+17
-1
lines changed

packages/flutter_tools/lib/src/cache.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -520,7 +520,7 @@ class Cache {
520520
if (_hasWarnedAboutStorageOverride) {
521521
return;
522522
}
523-
_logger.printStatus(
523+
_logger.printError(
524524
'Flutter assets will be downloaded from $overrideUrl. Make sure you trust this source!',
525525
emphasis: true,
526526
);

packages/flutter_tools/test/general.shard/cache_test.dart

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -319,6 +319,22 @@ void main() {
319319

320320
expect(() => cache.storageBaseUrl, throwsToolExit());
321321
});
322+
323+
testWithoutContext('overridden storage base url prints warning to STDERR', () async {
324+
final BufferLogger logger = BufferLogger.test();
325+
const String baseUrl = 'https://storage.com';
326+
final Cache cache = Cache.test(
327+
platform: FakePlatform(environment: <String, String>{
328+
'FLUTTER_STORAGE_BASE_URL': baseUrl,
329+
}),
330+
processManager: FakeProcessManager.any(),
331+
logger: logger,
332+
);
333+
334+
expect(cache.storageBaseUrl, baseUrl);
335+
expect(logger.errorText, contains('Flutter assets will be downloaded from $baseUrl'));
336+
expect(logger.statusText, isEmpty);
337+
});
322338
});
323339

324340
testWithoutContext('flattenNameSubdirs', () {

0 commit comments

Comments
 (0)