Consistently normalize URLs in CLI tool

This commit is contained in:
Simon Binder 2023-08-12 22:28:48 +02:00
parent 92dd82f49c
commit fb0533c204
No known key found for this signature in database
GPG Key ID: 7891917E4147B8C0
1 changed files with 6 additions and 1 deletions

View File

@ -19,7 +19,12 @@ class PhysicalDriftDriver {
PhysicalDriftDriver(this.driver, this._backend);
Uri uriFromPath(String path) => _backend.provider.pathContext.toUri(path);
Uri uriFromPath(String path) {
final pathUri = _backend.provider.pathContext.toUri(path);
// Normalize to package URI if necessary.
return _backend.resolveUri(pathUri, '');
}
Future<FileState> analyzeElementsForPath(String path) {
return driver.resolveElements(uriFromPath(path));