fix(shorebird_cli): use relative paths to manifest files in shorebird doctor (#419)

This commit is contained in:
Bryan Oltman
2023-05-02 14:17:43 -04:00
committed by GitHub
parent a584f856be
commit 5b49ed965a
2 changed files with 12 additions and 8 deletions
@@ -66,7 +66,9 @@ class AndroidInternetPermissionValidator extends Validator {
.map(
(String manifestPath) => ValidationIssue(
severity: ValidationIssueSeverity.error,
message: '$manifestPath is missing the INTERNET permission.',
message:
'${p.relative(manifestPath, from: Directory.current.path)} '
'is missing the INTERNET permission.',
fix: () => _addInternetPermissionToFile(manifestPath),
),
)
@@ -110,7 +110,7 @@ void main() {
'INTERNET permission',
() async {
final tempDirectory = createTempDir();
final manifestPaths = [
final relativeManifestPaths = [
'internet_permission',
'debug',
'main',
@@ -118,7 +118,6 @@ void main() {
]
.map(
(dir) => p.join(
tempDirectory.path,
'android',
'app',
'src',
@@ -126,23 +125,26 @@ void main() {
),
)
.toList();
final badManifestPaths = manifestPaths.slice(1);
final absoluteManifestPaths = relativeManifestPaths
.map((path) => p.join(tempDirectory.path, path))
.toList();
final badManifestPaths = relativeManifestPaths.slice(1);
writeManifestToPath(
manifestWithInternetPermission,
manifestPaths[0],
absoluteManifestPaths[0],
);
writeManifestToPath(
manifestWithCommentedOutInternetPermission,
manifestPaths[1],
absoluteManifestPaths[1],
);
writeManifestToPath(
manifestWithNonInternetPermissions,
manifestPaths[2],
absoluteManifestPaths[2],
);
writeManifestToPath(
manifestWithNoPermissions,
manifestPaths[3],
absoluteManifestPaths[3],
);
final results = await IOOverrides.runZoned(