OLD | NEW |
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file |
2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
4 | 4 |
5 library command_lish; | 5 library command_lish; |
6 | 6 |
7 import 'dart:io'; | 7 import 'dart:io'; |
8 import 'dart:json'; | 8 import 'dart:json'; |
9 import 'dart:uri'; | 9 import 'dart:uri'; |
10 | 10 |
11 import '../../pkg/args/lib/args.dart'; | 11 import '../../pkg/args/lib/args.dart'; |
12 import '../../pkg/http/lib/http.dart' as http; | 12 import '../../pkg/http/lib/http.dart' as http; |
13 import 'git.dart' as git; | 13 import 'git.dart' as git; |
14 import 'io.dart'; | 14 import 'io.dart'; |
15 import 'log.dart' as log; | 15 import 'log.dart' as log; |
16 import 'oauth2.dart' as oauth2; | 16 import 'oauth2.dart' as oauth2; |
17 import 'pub.dart'; | 17 import 'pub.dart'; |
18 import 'validator.dart'; | 18 import 'validator.dart'; |
19 | 19 |
20 // TODO(nweiz): Make "publish" the primary name for this command. See issue | 20 // TODO(nweiz): Make "publish" the primary name for this command. See issue |
21 // 6949. | 21 // 6949. |
22 /// Handles the `lish` and `publish` pub commands. | 22 /// Handles the `lish` and `publish` pub commands. |
23 class LishCommand extends PubCommand { | 23 class LishCommand extends PubCommand { |
24 final description = "publish the current package to pub.dartlang.org"; | 24 final description = "Publish the current package to pub.dartlang.org."; |
25 final usage = "pub publish [options]"; | 25 final usage = "pub publish [options]"; |
26 final aliases = const ["lish", "lush"]; | 26 final aliases = const ["lish", "lush"]; |
27 | 27 |
28 ArgParser get commandParser { | 28 ArgParser get commandParser { |
29 var parser = new ArgParser(); | 29 var parser = new ArgParser(); |
30 parser.addOption('server', defaultsTo: 'https://pub.dartlang.org', | 30 parser.addOption('server', defaultsTo: 'https://pub.dartlang.org', |
31 help: 'The package server to which to upload this package'); | 31 help: 'The package server to which to upload this package'); |
32 return parser; | 32 return parser; |
33 } | 33 } |
34 | 34 |
(...skipping 154 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
189 var s = warnings.length == 1 ? '' : 's'; | 189 var s = warnings.length == 1 ? '' : 's'; |
190 stdout.writeString("Package has ${warnings.length} warning$s. Upload " | 190 stdout.writeString("Package has ${warnings.length} warning$s. Upload " |
191 "anyway (y/n)? "); | 191 "anyway (y/n)? "); |
192 return readLine().transform((line) { | 192 return readLine().transform((line) { |
193 if (new RegExp(r"^[yY]").hasMatch(line)) return; | 193 if (new RegExp(r"^[yY]").hasMatch(line)) return; |
194 throw "Package upload canceled."; | 194 throw "Package upload canceled."; |
195 }); | 195 }); |
196 }); | 196 }); |
197 } | 197 } |
198 } | 198 } |
OLD | NEW |