Skip to content

Commit

Permalink
Fix trailing slash logic when writing .packages (flutter#55)
Browse files Browse the repository at this point in the history
  • Loading branch information
jonasfj authored and lrhn committed Sep 2, 2019
1 parent 3fb3733 commit 0b0bd8c
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
## 1.2.0
- Added support for writing default-package entries.
- Fixed bug when writing `Uri`s containing a fragment.

## 1.1.0

Expand Down
4 changes: 2 additions & 2 deletions lib/packages_file.dart
Original file line number Diff line number Diff line change
Expand Up @@ -162,10 +162,10 @@ void write(StringSink output, Map<String, Uri> packageMapping,
if (baseUri != null) {
uri = _relativize(uri, baseUri);
}
output.write(uri);
if (!uri.path.endsWith('/')) {
output.write('/');
uri = uri.replace(path: uri.path + '/');
}
output.write(uri);
output.writeln();
});
}
Expand Down

0 comments on commit 0b0bd8c

Please sign in to comment.