| Index: utils/pub/package.dart
|
| diff --git a/utils/pub/package.dart b/utils/pub/package.dart
|
| index 4b52092998d80d44f67440dccea8815cae05c984..24807e723d2209d45ac4dcf9550ed0d986c8ff73 100644
|
| --- a/utils/pub/package.dart
|
| +++ b/utils/pub/package.dart
|
| @@ -43,7 +43,11 @@ class Package {
|
| /**
|
| * The name of the package.
|
| */
|
| - final String name;
|
| + String get name() {
|
| + if (pubspec.name != null) return pubspec.name;
|
| + if (dir != null) return basename(dir);
|
| + return null;
|
| + }
|
|
|
| /**
|
| * The package's version.
|
| @@ -62,19 +66,17 @@ class Package {
|
| Collection<PackageRef> get dependencies => pubspec.dependencies;
|
|
|
| /**
|
| - * Constructs a package with the given name and pubspec. The package will
|
| - * no directory associated with it.
|
| + * Constructs a package with the given pubspec. The package will have no
|
| + * directory associated with it.
|
| */
|
| - Package.inMemory(this.name, this.pubspec)
|
| + Package.inMemory(this.pubspec)
|
| : dir = null;
|
|
|
| /**
|
| * Constructs a package. This should not be called directly. Instead, acquire
|
| * packages from [load()].
|
| */
|
| - Package._(String dir, this.pubspec)
|
| - : dir = dir,
|
| - name = basename(dir);
|
| + Package._(this.dir, this.pubspec);
|
|
|
| /**
|
| * Returns a debug string for the package.
|
|
|