Skip to content

Commit 94b836e

Browse files
[flutter_plugin_tools] Fix pubspec-check on Windows (flutter#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.
1 parent 4b6b6b2 commit 94b836e

File tree

3 files changed

+247
-193
lines changed

3 files changed

+247
-193
lines changed

script/tool/CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
- `pubspec-check` now checks that the description is of the pub-recommended
1515
length.
1616
- Fix `license-check` when run on Windows with line ending conversion enabled.
17+
- Fixed `pubspec-check` on Windows.
1718

1819
## 0.7.1
1920

script/tool/lib/src/pubspec_check_command.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,7 @@ class PubspecCheckCommand extends PackageLoopingCommand {
177177
errorMessages.add('Missing "repository"');
178178
} else {
179179
final String relativePackagePath =
180-
path.relative(package.path, from: packagesDir.parent.path);
180+
getRelativePosixPath(package.directory, from: packagesDir.parent);
181181
if (!pubspec.repository!.path.endsWith(relativePackagePath)) {
182182
errorMessages
183183
.add('The "repository" link should end with the package path.');

0 commit comments

Comments
 (0)