| Index: sdk/lib/_internal/pub/lib/src/command/lish.dart
|
| diff --git a/sdk/lib/_internal/pub/lib/src/command/lish.dart b/sdk/lib/_internal/pub/lib/src/command/lish.dart
|
| index a58ae3c6ad73ddf9ae8947da0f1f670857c032a6..8263505637c2c02ab753c154a1dfa88871afb276 100644
|
| --- a/sdk/lib/_internal/pub/lib/src/command/lish.dart
|
| +++ b/sdk/lib/_internal/pub/lib/src/command/lish.dart
|
| @@ -26,7 +26,20 @@ class LishCommand extends PubCommand {
|
| List<String> get aliases => const ["lish", "lush"];
|
|
|
| /// The URL of the server to which to upload the package.
|
| - Uri get server => Uri.parse(commandOptions['server']);
|
| + Uri get server {
|
| + // An explicit argument takes precedence.
|
| + if (commandOptions.wasParsed('server')) {
|
| + return Uri.parse(commandOptions['server']);
|
| + }
|
| +
|
| + // Otherwise, use the one specified in the pubspec.
|
| + if (entrypoint.root.pubspec.publishTo != null) {
|
| + return Uri.parse(entrypoint.root.pubspec.publishTo);
|
| + }
|
| +
|
| + // Otherwise, use the default.
|
| + return Uri.parse(HostedSource.defaultUrl);
|
| + }
|
|
|
| /// Whether the publish is just a preview.
|
| bool get dryRun => commandOptions['dry-run'];
|
| @@ -98,6 +111,12 @@ class LishCommand extends PubCommand {
|
| usageError('Cannot use both --force and --dry-run.');
|
| }
|
|
|
| + if (entrypoint.root.pubspec.isPrivate) {
|
| + dataError('A private package cannot be published.\n'
|
| + 'You can enable this by changing the "publishTo" field in your '
|
| + 'pubspec.');
|
| + }
|
| +
|
| var files = entrypoint.root.listFiles();
|
| log.fine('Archiving and publishing ${entrypoint.root}.');
|
|
|
|
|