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 /// Helper functionality for invoking Git. | 5 /// Helper functionality for invoking Git. |
6 library pub.git; | |
7 | |
8 import 'dart:async'; | 6 import 'dart:async'; |
9 import 'dart:io'; | 7 import 'dart:io'; |
10 | 8 |
11 import 'package:stack_trace/stack_trace.dart'; | 9 import 'package:stack_trace/stack_trace.dart'; |
12 | 10 |
13 import 'exceptions.dart'; | 11 import 'exceptions.dart'; |
14 import 'io.dart'; | 12 import 'io.dart'; |
15 import 'log.dart' as log; | 13 import 'log.dart' as log; |
16 import 'utils.dart'; | 14 import 'utils.dart'; |
17 | 15 |
(...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
114 var result = runProcessSync(command, ["--version"]); | 112 var result = runProcessSync(command, ["--version"]); |
115 var regexp = new RegExp("^git version"); | 113 var regexp = new RegExp("^git version"); |
116 return result.stdout.length == 1 && regexp.hasMatch(result.stdout.single); | 114 return result.stdout.length == 1 && regexp.hasMatch(result.stdout.single); |
117 } on ProcessException catch (error, stackTrace) { | 115 } on ProcessException catch (error, stackTrace) { |
118 var chain = new Chain.forTrace(stackTrace); | 116 var chain = new Chain.forTrace(stackTrace); |
119 // If the process failed, they probably don't have it. | 117 // If the process failed, they probably don't have it. |
120 log.error('Git command is not "$command": $error\n$chain'); | 118 log.error('Git command is not "$command": $error\n$chain'); |
121 return false; | 119 return false; |
122 } | 120 } |
123 } | 121 } |
OLD | NEW |