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

Side by Side Diff: utils/pub/git.dart

Issue 11087039: Print out the working directory when git fails. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 years, 2 months 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | utils/pub/io.dart » ('j') | utils/pub/pub.dart » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 /** 5 /**
6 * Helper functionality for invoking Git. 6 * Helper functionality for invoking Git.
7 */ 7 */
8 library git; 8 library git;
9 9
10 import 'io.dart'; 10 import 'io.dart';
(...skipping 11 matching lines...) Expand all
22 } 22 }
23 23
24 /// Run a git process with [args] from [workingDir]. Returns the stdout as a 24 /// Run a git process with [args] from [workingDir]. Returns the stdout as a
25 /// list of strings if it succeeded. Completes to an exception if it failed. 25 /// list of strings if it succeeded. Completes to an exception if it failed.
26 Future<List<String>> run(List<String> args, [String workingDir]) { 26 Future<List<String>> run(List<String> args, [String workingDir]) {
27 return _gitCommand.chain((git) { 27 return _gitCommand.chain((git) {
28 return runProcess(git, args, workingDir); 28 return runProcess(git, args, workingDir);
29 }).transform((result) { 29 }).transform((result) {
30 if (!result.success) throw new Exception( 30 if (!result.success) throw new Exception(
31 'Git error. Command: git ${Strings.join(args, " ")}\n' 31 'Git error. Command: git ${Strings.join(args, " ")}\n'
32 'Working directory: $currentWorkingDir\n'
32 '${Strings.join(result.stderr, "\n")}'); 33 '${Strings.join(result.stderr, "\n")}');
33 34
34 return result.stdout; 35 return result.stdout;
35 }); 36 });
36 } 37 }
37 38
38 bool _isGitInstalledCache; 39 bool _isGitInstalledCache;
39 40
40 /// The cached Git command. 41 /// The cached Git command.
41 String _gitCommandCache; 42 String _gitCommandCache;
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
76 }); 77 });
77 78
78 future.handleException((err) { 79 future.handleException((err) {
79 // If the process failed, they probably don't have it. 80 // If the process failed, they probably don't have it.
80 completer.complete(false); 81 completer.complete(false);
81 return true; 82 return true;
82 }); 83 });
83 84
84 return completer.future; 85 return completer.future;
85 } 86 }
OLDNEW
« no previous file with comments | « no previous file | utils/pub/io.dart » ('j') | utils/pub/pub.dart » ('J')

Powered by Google App Engine
This is Rietveld 408576698