which 0.1.3

  • README.md
  • CHANGELOG.md
  • Installing
  • Versions
  • 58

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.1.3

  • Assume owner/group matches that of executable until it's possible to check. (#5)

1. Depend on it

Add this to your package's pubspec.yaml file:


dependencies:
  which: "^0.1.3"

2. Install it

You can install packages from the command line:

with pub:


$ pub get

with Flutter:


$ flutter packages get

Alternatively, your editor might support pub get or packages get. Check the docs for your editor to learn more.

3. Import it

Now in your Dart code, you can use:


import 'package:which/which.dart';
        
Version Uploaded Documentation Archive
0.1.3 Feb 12, 2015 Go to the documentation of which 0.1.3 Download which 0.1.3 archive
0.1.2 Jan 15, 2015 Go to the documentation of which 0.1.2 Download which 0.1.2 archive
0.1.1 Jan 14, 2015 Go to the documentation of which 0.1.1 Download which 0.1.1 archive
0.1.0 Jan 13, 2015 Go to the documentation of which 0.1.0 Download which 0.1.0 archive

Analysis

This feature is new.
We welcome feedback.

We analyzed this package, and provided a score, details, and suggestions below.

  • completed on Dec 6, 2017
  • Dart: 2.0.0-dev.8.0
  • pana: 0.7.3+1

Scores

Popularity:
Describes how popular the package is relative to other packages. [more]
58
Health:
Code health derived from static analysis. [more]
94
Maintenance:
Reflects how tidy and up-to-date the package is. [more]
0
Overall score:
Weighted score of the above. [more]
58

Platforms

Detected platforms: Flutter, server

all of the above

Suggestions

  • Maintain CHANGELOG.md.

    Changelog entries help clients to follow the progress in your code.

Dependencies

Package Constraint Resolved Available
Direct dependencies
path >=1.3.1 <2.0.0 1.5.1
when >=0.2.0 <0.3.0 0.2.0
Dev dependencies
mockito >=0.8.1 <0.9.0
unittest >=0.11.4 <0.12.0