v0.1.0
4 files changed
tree: 68a29e44d8b76bd4a8b9a8f8c21be30cff715c48
  1. bin/
  2. lib/
  3. test/
  4. .gitignore
  5. drone.sh
  6. LICENSE
  7. pubspec.yaml
  8. README.md
README.md

which pub package Build Status Coverage Status

Like the which(1) unix command. Check for and locate installed executables.

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