Chromium Code Reviews| Index: sdk/lib/_internal/pub/lib/src/package.dart |
| diff --git a/sdk/lib/_internal/pub/lib/src/package.dart b/sdk/lib/_internal/pub/lib/src/package.dart |
| index 3dd84e2d253facf02d1f199f47644495037b39df..7d7b00bd9811454b2583c06dbabd014b18261f64 100644 |
| --- a/sdk/lib/_internal/pub/lib/src/package.dart |
| +++ b/sdk/lib/_internal/pub/lib/src/package.dart |
| @@ -142,11 +142,18 @@ class Package { |
| /// If this is a Git repository, this will respect .gitignore; otherwise, it |
| /// will return all non-hidden, non-blacklisted files. |
| /// |
| - /// If [beneath] is passed, this will only return files beneath that path. If |
| + /// If [beneath] is passed, this will only return files beneath that path, |
| + /// which is expected to be relative to the package's root directory. If |
|
nweiz
2014/09/17 22:58:27
I think you missed an update for this in [Package.
Bob Nystrom
2014/09/18 19:17:53
Done.
|
| /// [recursive] is true, this will return all files beneath that path; |
| /// otherwise, it will only return files one level beneath it. |
| List<String> listFiles({String beneath, recursive: true}) { |
| - if (beneath == null) beneath = dir; |
| + if (beneath == null) { |
| + beneath = dir; |
| + } else { |
| + beneath = path.join(dir, beneath); |
| + } |
| + |
| + if (!dirExists(beneath)) return []; |
| // This is used in some performance-sensitive paths and can list many, many |
| // files. As such, it leans more havily towards optimization as opposed to |