Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(349)

Unified Diff: sdk/lib/_internal/pub/lib/src/command/lish.dart

Issue 64683012: Don't allow accidentally publishing to pub.dartlang.org from the dev version of pub. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 d5b6b50f51009ff2ff4f733175a4962d3f74c4ca..1cc95ace29773c7b68628666a7b7a8dddbbf7371 100644
--- a/sdk/lib/_internal/pub/lib/src/command/lish.dart
+++ b/sdk/lib/_internal/pub/lib/src/command/lish.dart
@@ -15,6 +15,7 @@ import '../http.dart';
import '../io.dart';
import '../log.dart' as log;
import '../oauth2.dart' as oauth2;
+import '../sdk.dart' as sdk;
import '../source/hosted.dart';
import '../utils.dart';
import '../validator.dart';
@@ -93,6 +94,15 @@ class LishCommand extends PubCommand {
}
Future onRun() {
+ // Sanity check. Don't push to the production server when running tests or
+ // developing on pub.
+ if (sdk.isBleedingEdge &&
+ server.toString() == HostedSource.defaultUrl &&
+ !dryRun) {
+ log.error('Cannot publish to $server from bleeding edge pub!');
+ return null;
+ }
+
if (force && dryRun) {
log.error('Cannot use both --force and --dry-run.');
this.printUsage();
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698