Merge branch 'master' into fix_bug_ref

Conflicts:
	lib/src/util.dart
tree: 7781c02e3c5bdf664eb7f4658ce9d23773808311
  1. lib/
  2. test/
  3. tool/
  4. .gitignore
  5. .travis.yml
  6. AUTHORS
  7. CHANGELOG.md
  8. CONTRIBUTING.md
  9. LICENSE
  10. pubspec.yaml
  11. README.md
README.md

which pub package Build Status Coverage Status

Check for and locate installed executables. Just like unix which(1), except:

  • Doesn't shell out (fast).
  • Cross-platform (works on windows).

Install

pub global activate den
den install which

Usage

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]);
}