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

Unified Diff: packages/which/README.md

Issue 1400473008: Roll Observatory packages and add a roll script (Closed) Base URL: git@github.com:dart-lang/observatory_pub_packages.git@master
Patch Set: Created 5 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « packages/which/LICENSE ('k') | packages/which/drone.sh » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 [![pub package](http://img.shields.io/pub/v/which.svg)](https://pub.dartlang.org/packages/which) [![Build Status](https://drone.io/github.com/seaneagan/which.dart/status.png)](https://drone.io/github.com/seaneagan/which.dart/latest) [![Coverage Status](https://img.shields.io/coveralls/seaneagan/which.dart.svg)](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
« no previous file with comments | « packages/which/LICENSE ('k') | packages/which/drone.sh » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698