[flutter_plugin_tools] Fix pubspec-check on Windows (#4428)

The repository check always failed when run on Windows, because the
relative path generated to check the end of the URL was using local
filesystem style for separators, but URLs always use POSIX separators.
This commit is contained in:
stuartmorgan
2021-10-25 11:29:07 -04:00
committed by GitHub
parent 5bd3ae6a0a
commit 78395e5adf
3 changed files with 258 additions and 204 deletions

View File

@ -177,7 +177,7 @@ class PubspecCheckCommand extends PackageLoopingCommand {
errorMessages.add('Missing "repository"');
} else {
final String relativePackagePath =
path.relative(package.path, from: packagesDir.parent.path);
getRelativePosixPath(package.directory, from: packagesDir.parent);
if (!pubspec.repository!.path.endsWith(relativePackagePath)) {
errorMessages
.add('The "repository" link should end with the package path.');