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_uploader; | 5 library command_uploader; |
6 | 6 |
7 import 'dart:io'; | 7 import 'dart:io'; |
8 import 'dart:uri'; | 8 import 'dart:uri'; |
9 | 9 |
10 import '../../pkg/args/lib/args.dart'; | 10 import '../../pkg/args/lib/args.dart'; |
| 11 import '../../pkg/path/lib/path.dart' as path; |
11 import 'entrypoint.dart'; | 12 import 'entrypoint.dart'; |
12 import 'exit_codes.dart' as exit_codes; | 13 import 'exit_codes.dart' as exit_codes; |
13 import 'http.dart'; | 14 import 'http.dart'; |
14 import 'io.dart'; | 15 import 'io.dart'; |
15 import 'log.dart' as log; | 16 import 'log.dart' as log; |
16 import 'oauth2.dart' as oauth2; | 17 import 'oauth2.dart' as oauth2; |
17 import 'path.dart' as path; | |
18 import 'pub.dart'; | 18 import 'pub.dart'; |
19 | 19 |
20 /// Handles the `uploader` pub command. | 20 /// Handles the `uploader` pub command. |
21 class UploaderCommand extends PubCommand { | 21 class UploaderCommand extends PubCommand { |
22 final description = "Manage uploaders for a package on pub.dartlang.org."; | 22 final description = "Manage uploaders for a package on pub.dartlang.org."; |
23 final usage = "pub uploader [options] {add/remove} <email>"; | 23 final usage = "pub uploader [options] {add/remove} <email>"; |
24 final requiresEntrypoint = false; | 24 final requiresEntrypoint = false; |
25 | 25 |
26 ArgParser get commandParser { | 26 ArgParser get commandParser { |
27 var parser = new ArgParser(); | 27 var parser = new ArgParser(); |
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
73 "/uploaders/${encodeUriComponent(uploader)}.json"); | 73 "/uploaders/${encodeUriComponent(uploader)}.json"); |
74 return client.delete(url); | 74 return client.delete(url); |
75 } | 75 } |
76 }); | 76 }); |
77 }).transform(handleJsonSuccess).transformException((e) { | 77 }).transform(handleJsonSuccess).transformException((e) { |
78 if (e is! PubHttpException) throw e; | 78 if (e is! PubHttpException) throw e; |
79 handleJsonError(e.response); | 79 handleJsonError(e.response); |
80 }); | 80 }); |
81 } | 81 } |
82 } | 82 } |
OLD | NEW |