Skip to content
Snippets Groups Projects
Commit b5d62448 authored by rnystrom@google.com's avatar rnystrom@google.com Committed by Natalie Weizenbaum
Browse files

Don't allow accidentally publishing to pub.dartlang.org from the dev version of pub.

BUG=https://code.google.com/p/dart/issues/detail?id=7336
R=nweiz@google.com

Review URL: https://codereview.chromium.org//64683012

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge@30538 260f80e4-7a28-3924-810f-c04153c831b5
parent 8bf75818
No related branches found
No related tags found
No related merge requests found
......@@ -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();
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment