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 /** | 5 /// Helper functionality for invoking Git. |
6 * Helper functionality for invoking Git. | |
7 */ | |
8 library git; | 6 library git; |
9 | 7 |
10 import 'io.dart'; | 8 import 'io.dart'; |
11 import 'log.dart' as log; | 9 import 'log.dart' as log; |
12 import 'utils.dart'; | 10 import 'utils.dart'; |
13 | 11 |
14 /// Tests whether or not the git command-line app is available for use. | 12 /// Tests whether or not the git command-line app is available for use. |
15 Future<bool> get isInstalled { | 13 Future<bool> get isInstalled { |
16 if (_isGitInstalledCache != null) { | 14 if (_isGitInstalledCache != null) { |
17 // TODO(rnystrom): The sleep is to pump the message queue. Can use | 15 // TODO(rnystrom): The sleep is to pump the message queue. Can use |
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
77 regex.hasMatch(results.stdout[0])); | 75 regex.hasMatch(results.stdout[0])); |
78 }); | 76 }); |
79 | 77 |
80 future.handleException((err) { | 78 future.handleException((err) { |
81 // If the process failed, they probably don't have it. | 79 // If the process failed, they probably don't have it. |
82 completer.complete(false); | 80 completer.complete(false); |
83 return true; | 81 return true; |
84 }); | 82 }); |
85 | 83 |
86 return completer.future; | 84 return completer.future; |
87 } | 85 } |
OLD | NEW |