| Index: utils/pub/source.dart
|
| diff --git a/utils/pub/source.dart b/utils/pub/source.dart
|
| index da01f1214930d47b5c335afc66334e182f770407..3e4eb087c0be0f89a957844e13fef924311c8778 100644
|
| --- a/utils/pub/source.dart
|
| +++ b/utils/pub/source.dart
|
| @@ -10,6 +10,22 @@
|
| */
|
| class Source {
|
| /**
|
| + * The default [Source] from which to fetch packages if no other [Source] is
|
| + * specified.
|
| + */
|
| + static Source defaultSource;
|
| +
|
| + /**
|
| + * Looks up a source based on its name.
|
| + */
|
| + static Source fromName(String name) {
|
| + // TODO(nweiz): add a more principled way of registering sources here once
|
| + // we have more than one source. Especially important for plugins.
|
| + if (name == 'sdk') return defaultSource;
|
| + throw 'Unknown source "$name"';
|
| + }
|
| +
|
| + /**
|
| * The name of the source. Should be lower-case, suitable for use in a
|
| * filename, and unique accross all sources.
|
| */
|
|
|