Make FilesystemImport._loadPath absolute (#651)

This avoids having the effective load path change when the process's
working directory changes.
This commit is contained in:
Natalie Weizenbaum 2019-04-18 16:34:48 -07:00 committed by GitHub
parent 3b3a43a8f9
commit 413c949446
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 9 additions and 2 deletions

View File

@ -1,3 +1,10 @@
## 1.18.1
### Dart API
* `FilesystemImporter` now doesn't change its effective directory if the working
directory changes, even if it's passed a relative argument.
## 1.18.0
* Avoid recursively listing directories when finding the canonical name of a

View File

@ -18,7 +18,7 @@ class FilesystemImporter extends Importer {
final String _loadPath;
/// Creates an importer that loads files relative to [loadPath].
FilesystemImporter(this._loadPath);
FilesystemImporter(String loadPath) : _loadPath = p.absolute(loadPath);
Uri canonicalize(Uri url) {
if (url.scheme != 'file' && url.scheme != '') return null;

View File

@ -1,5 +1,5 @@
name: sass
version: 1.18.0
version: 1.18.1-dev
description: A Sass implementation in Dart.
author: Dart Team <misc@dartlang.org>
homepage: https://github.com/sass/dart-sass