begin migrating //flutter/dev/tools to null-safety (#80834)
This commit is contained in:
committed by
GitHub
parent
e5414695d4
commit
8654e4ae3e
@@ -25,8 +25,8 @@ Future<void> main(List<String> args) async {
|
||||
/// Fetches the zip archive at the specified url.
|
||||
///
|
||||
/// Returns null if the archive fails to download after [maxTries] attempts.
|
||||
Future<Archive> fetchArchive(String url, int maxTries) async {
|
||||
List<int> responseBytes;
|
||||
Future<Archive?> fetchArchive(String url, int maxTries) async {
|
||||
List<int>? responseBytes;
|
||||
for (int i = 0; i < maxTries; i++) {
|
||||
final http.Response response = await http.get(Uri.parse(url));
|
||||
if (response.statusCode == 200) {
|
||||
@@ -45,7 +45,7 @@ Future<Archive> fetchArchive(String url, int maxTries) async {
|
||||
|
||||
Future<void> generateDocs(String url, String docName, String checkFile) async {
|
||||
const int maxTries = 5;
|
||||
final Archive archive = await fetchArchive(url, maxTries);
|
||||
final Archive? archive = await fetchArchive(url, maxTries);
|
||||
if (archive == null) {
|
||||
stderr.writeln('Failed to fetch zip archive from: $url after $maxTries attempts. Giving up.');
|
||||
exit(1);
|
||||
|
||||
Reference in New Issue
Block a user