which 0.1.3 copy "which: ^0.1.3" to clipboard
which: ^0.1.3 copied to clipboard

Dart 1 only

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

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]);
}
0
likes
15
pub points
0%
popularity

Publisher

unverified uploader

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

Repository (GitHub)
View/report issues

License

BSD-3-Clause (license)

Dependencies

path, when

More

Packages that depend on which