Skip to content

Commit 0b0bd8c

Browse files
jonasfjlrhn
authored andcommitted
Fix trailing slash logic when writing .packages (flutter#55)
1 parent 3fb3733 commit 0b0bd8c

2 files changed

Lines changed: 3 additions & 2 deletions

File tree

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
## 1.2.0
22
- Added support for writing default-package entries.
3+
- Fixed bug when writing `Uri`s containing a fragment.
34

45
## 1.1.0
56

lib/packages_file.dart

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -162,10 +162,10 @@ void write(StringSink output, Map<String, Uri> packageMapping,
162162
if (baseUri != null) {
163163
uri = _relativize(uri, baseUri);
164164
}
165-
output.write(uri);
166165
if (!uri.path.endsWith('/')) {
167-
output.write('/');
166+
uri = uri.replace(path: uri.path + '/');
168167
}
168+
output.write(uri);
169169
output.writeln();
170170
});
171171
}

0 commit comments

Comments
 (0)