Skip to content

Commit aa88662

Browse files
Formatted
1 parent 54b6272 commit aa88662

File tree

1 file changed

+14
-7
lines changed

1 file changed

+14
-7
lines changed

bin/src/repo/license_repository.dart

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,8 @@ import '../util/logger.dart';
1616

1717
const _flutterHomeUrl = 'https://flutter.dev/';
1818
const _flutterRepoUrl = 'https://github.com/flutter/flutter';
19-
const _flutterLicenseUrl = 'https://raw.githubusercontent.com/flutter/flutter/master/LICENSE';
19+
const _flutterLicenseUrl =
20+
'https://raw.githubusercontent.com/flutter/flutter/master/LICENSE';
2021

2122
const _allowedLicenseFilesName = [
2223
'LICENSE',
@@ -45,18 +46,22 @@ class LicenseRepository {
4546
this._pubDevWebservice,
4647
);
4748

48-
Future<DependencyLicenseData> getLicenseDataForDependency(Params params, Dependency dependency, DependencyLock lockedDependency) async {
49+
Future<DependencyLicenseData> getLicenseDataForDependency(Params params,
50+
Dependency dependency, DependencyLock lockedDependency) async {
4951
if (dependency.isPartOfFlutterSdk) return _getFlutterLicenseData();
5052
final licenseOverride = params.dependencyOverrides[dependency.name];
5153
var licenseUrl = licenseOverride;
52-
final pubDevData = await _pubDevWebservice.getPubDevData(dependency, lockedDependency);
54+
final pubDevData =
55+
await _pubDevWebservice.getPubDevData(dependency, lockedDependency);
5356
if (licenseOverride == null) {
54-
final configData = await _configService.getConfigData(dependency, lockedDependency);
57+
final configData =
58+
await _configService.getConfigData(dependency, lockedDependency);
5559
licenseUrl = _guessLocalLicenseFile(configData.rootUri);
5660
Logger.logVerbose("GET LICENSE AT '${configData.rootUri}' - $licenseUrl");
5761
}
5862
if (licenseUrl == null) {
59-
throw FatalException("Failed to get the license url for '${dependency.name}'");
63+
throw FatalException(
64+
"Failed to get the license url for '${dependency.name}'");
6065
}
6166
final licenseData = await _getLicenseDataByUrl(licenseUrl);
6267
return DependencyLicenseData(
@@ -66,7 +71,8 @@ class LicenseRepository {
6671
);
6772
}
6873

69-
Future<DependencyLicenseData> getLicenseDataForExtraDependency(ExtraDependency dependency) async {
74+
Future<DependencyLicenseData> getLicenseDataForExtraDependency(
75+
ExtraDependency dependency) async {
7076
if (dependency.isPartOfFlutterSdk) return _getFlutterLicenseData();
7177
final license = await _getLicenseDataByUrl(dependency.licenseUrl);
7278
return DependencyLicenseData(
@@ -88,7 +94,8 @@ class LicenseRepository {
8894
if (packagePath.isNotEmpty) {
8995
final packageFolder = Directory(packagePath);
9096
if (!packageFolder.existsSync()) {
91-
throw FatalException(".dart_tool/package_config.json is not up to date. Path: '$packagePath' does not exist anymore.");
97+
throw FatalException(
98+
".dart_tool/package_config.json is not up to date. Path: '$packagePath' does not exist anymore.");
9299
}
93100
}
94101
for (final fileName in _allowedLicenseFilesName) {

0 commit comments

Comments
 (0)