Clone this repo:

Branches

  1. b92330b Roll coveralls back to latest. (Fix #11.) by Phil Quitslund · 9 years ago master
  2. 23f5ad9 Merge branch 'fix_bug_ref' by pq · 9 years ago 0.1.3+1
  3. f94ad97 Merge branch 'master' into fix_bug_ref by pq · 9 years ago
  4. c702b3e Merge pull request #12 from dart-lang/fixes by Phil Quitslund · 9 years ago
  5. d439a1c fix missing bug reference by Sean Eagan · 9 years ago

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