| OLD | NEW |
| (Empty) |
| 1 which [](https://pub.dartla
ng.org/packages/which) [](https://drone.io/github.com/seaneagan/which.dart/latest) [
](h
ttps://coveralls.io/r/seaneagan/which.dart?branch=master) | |
| 2 ===== | |
| 3 | |
| 4 Check for and locate installed executables. Just like unix [which(1)][unix_whic
h], except: | |
| 5 | |
| 6 * Doesn't shell out (fast). | |
| 7 * Cross-platform (works on windows). | |
| 8 | |
| 9 ## Install | |
| 10 | |
| 11 ```shell | |
| 12 pub global activate den | |
| 13 den install which | |
| 14 ``` | |
| 15 | |
| 16 ## Usage | |
| 17 | |
| 18 ```dart | |
| 19 import 'dart:io'; | |
| 20 | |
| 21 import 'package:which/which.dart'; | |
| 22 | |
| 23 main(arguments) async { | |
| 24 | |
| 25 // Asynchronously | |
| 26 var git = await which('git', orElse: () => null); | |
| 27 | |
| 28 // Or synchronously | |
| 29 var git = whichSync('git', orElse: () => null); | |
| 30 | |
| 31 if (git == null) { | |
| 32 print('Please install git and try again'); | |
| 33 exit(1); | |
| 34 } | |
| 35 | |
| 36 await Process.run(git, ['add', '-A']); | |
| 37 await Process.run(git, ['commit', '-m', arguments.first]); | |
| 38 } | |
| 39 ``` | |
| 40 | |
| 41 [unix_which]: http://en.wikipedia.org/wiki/Which_%28Unix%29 | |
| OLD | NEW |