| 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; |
| 14 import 'io.dart'; |
| 15 import 'oauth2.dart' as oauth2; |
| 13 import 'pub.dart'; | 16 import 'pub.dart'; |
| 14 import 'io.dart'; | |
| 15 import 'git.dart' as git; | |
| 16 import 'oauth2.dart' as oauth2; | |
| 17 import 'validator.dart'; | 17 import 'validator.dart'; |
| 18 | 18 |
| 19 // TODO(nweiz): Make "publish" the primary name for this command. See issue | 19 // TODO(nweiz): Make "publish" the primary name for this command. See issue |
| 20 // 6949. | 20 // 6949. |
| 21 /// Handles the `lish` and `publish` pub commands. | 21 /// Handles the `lish` and `publish` pub commands. |
| 22 class LishCommand extends PubCommand { | 22 class LishCommand extends PubCommand { |
| 23 final description = "publish the current package to pub.dartlang.org"; | 23 final description = "publish the current package to pub.dartlang.org"; |
| 24 final usage = "pub publish [options]"; | 24 final usage = "pub publish [options]"; |
| 25 final aliases = const ["lish", "lush"]; | 25 final aliases = const ["lish", "lush"]; |
| 26 | 26 |
| (...skipping 160 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 187 var s = warnings.length == 1 ? '' : 's'; | 187 var s = warnings.length == 1 ? '' : 's'; |
| 188 stdout.writeString("Package has ${warnings.length} warning$s. Upload " | 188 stdout.writeString("Package has ${warnings.length} warning$s. Upload " |
| 189 "anyway (y/n)? "); | 189 "anyway (y/n)? "); |
| 190 return readLine().transform((line) { | 190 return readLine().transform((line) { |
| 191 if (new RegExp(r"^[yY]").hasMatch(line)) return; | 191 if (new RegExp(r"^[yY]").hasMatch(line)) return; |
| 192 throw "Package upload canceled."; | 192 throw "Package upload canceled."; |
| 193 }); | 193 }); |
| 194 }); | 194 }); |
| 195 } | 195 } |
| 196 } | 196 } |
| OLD | NEW |