Index: packages/which/README.md |
diff --git a/packages/which/README.md b/packages/which/README.md |
new file mode 100755 |
index 0000000000000000000000000000000000000000..b4d1d8715f4d378078ce15878f203f94b44caadb |
--- /dev/null |
+++ b/packages/which/README.md |
@@ -0,0 +1,41 @@ |
+which [](https://pub.dartlang.org/packages/which) [](https://drone.io/github.com/seaneagan/which.dart/latest) [](https://coveralls.io/r/seaneagan/which.dart?branch=master) |
+===== |
+ |
+Check for and locate installed executables. Just like unix [which(1)][unix_which], except: |
+ |
+* Doesn't shell out (fast). |
+* Cross-platform (works on windows). |
+ |
+## Install |
+ |
+```shell |
+pub global activate den |
+den install which |
+``` |
+ |
+## Usage |
+ |
+```dart |
+import 'dart:io'; |
+ |
+import 'package:which/which.dart'; |
+ |
+main(arguments) async { |
+ |
+ // Asynchronously |
+ var git = await which('git', orElse: () => null); |
+ |
+ // Or synchronously |
+ var git = whichSync('git', orElse: () => null); |
+ |
+ if (git == null) { |
+ print('Please install git and try again'); |
+ exit(1); |
+ } |
+ |
+ await Process.run(git, ['add', '-A']); |
+ await Process.run(git, ['commit', '-m', arguments.first]); |
+} |
+``` |
+ |
+[unix_which]: http://en.wikipedia.org/wiki/Which_%28Unix%29 |