which 0.1.3

  • README.md
  • CHANGELOG.md
  • Installing
  • Versions
  • 59

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.
More details: scoring.

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

  • completed on Feb 3, 2018
  • Dart: 2.0.0-dev.20.0
  • pana: 0.10.1

Scores

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

Platforms

Detected platforms: Flutter, other

Primary library: package:which/which.dart with components: io.

Suggestions

  • Package is pre-v1 release.

    While there is nothing inherently wrong with versions of 0.*.*, it usually means that the author is still experimenting with the general direction API.

  • Maintain an example.

    Create a short demo in the example/ directory to show how to use this package. Common file name patterns include: main.dart, example.dart or you could also use which.dart.

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