which 0.1.3

  • README.md
  • CHANGELOG.md
  • Installing
  • Versions
  • 51

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

Alternatively, your editor might support pub 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

We analyzed this package on Apr 23, 2018, and provided a score, details, and suggestions below. Analysis was completed with status completed using:

  • Dart: 2.0.0-dev.49.0
  • pana: 0.10.6

Scores

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

Platforms

Detected platforms: unsure

Error(s) prevent platform classification:

Error(s) in lib/which.dart: The method tear-off 'stat' has type '(String) → Future<FileStat>' that isn't of expected type '(dynamic) → Future<FileStat>'. This means its parameter or return type does not match what is expected.

Suggestions

  • Fix platform conflicts.

    Error(s) prevent platform classification:

    Error(s) in lib/which.dart: The method tear-off 'stat' has type '(String) → Future<FileStat>' that isn't of expected type '(dynamic) → Future<FileStat>'. This means its parameter or return type does not match what is expected.

  • Fix analysis and formatting issues.

    Analysis or formatting checks reported 4 errors 6 hints.

    Make sure that the imported libraries are not in conflict. Error(s) in lib/which.dart: The method tear-off 'stat' has type '(String) → Future<FileStat>' that isn't of expected type '(dynamic) → Future<FileStat>'. This means its parameter or return type does not match what is expected.

    Strong-mode analysis of lib/src/util.dart failed with the following error:

    line: 14 col: 48
    The named parameter 'defaultValue' isn't defined.

    Similar analysis of the following files failed:

    • lib/src/candidate_paths.dart (hint)
    • lib/src/has_permission.dart (hint)
    • lib/src/is_executable.dart (hint)
    • lib/src/which_impl.dart (hint)
  • 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