re-upload of lost dart code
 
 
Go to file
nixo e8e56309a6 init (v1.24.3) 2020-02-18 21:56:18 +01:00
lib init (v1.24.3) 2020-02-18 21:56:18 +01:00
test init (v1.24.3) 2020-02-18 21:56:18 +01:00
tool init (v1.24.3) 2020-02-18 21:56:18 +01:00
.gitignore init (v1.24.3) 2020-02-18 21:56:18 +01:00
.travis.yml init (v1.24.3) 2020-02-18 21:56:18 +01:00
AUTHORS init (v1.24.3) 2020-02-18 21:56:18 +01:00
CHANGELOG.md init (v1.24.3) 2020-02-18 21:56:18 +01:00
CONTRIBUTING.md init (v1.24.3) 2020-02-18 21:56:18 +01:00
LICENSE init (v1.24.3) 2020-02-18 21:56:18 +01:00
README.md init (v1.24.3) 2020-02-18 21:56:18 +01:00
pubspec.yaml init (v1.24.3) 2020-02-18 21:56:18 +01:00

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