process_run 0.10.1

  • README.md
  • CHANGELOG.md
  • Example
  • Installing
  • Versions
  • 90

process_run #

Process run helpers for Linux/Win/Mac.

Build Status

Goals #

Currently using Process.run does not stream output which is not convenient for lengthy operation. It requires using Process.start in a more complex way.

run and runCmd add verbose helper for that. Also dart binaries (pub, dart2js...) and any script can be called consistently on Mac/Windows/Linux

ProcessCmd allow creating command object that can be run and modified.

Usage #

run #

Additional options to Process.run are

  • specifying stdin
  • making it verbose

Additional feature

  • It tries to resolve simple command like dart, firebase, flutter, or any script available on the user path on any Platform.
import 'package:process_run/process_run.dart';

Display dart version and the command executed:

await run('dart', ['--version'], verbose: true);

which #

Like unix which, it searches for installed executables

import 'package:process_run/which.dart';

Find flutter and firebase executables:

var flutterExectutable = whichSync('flutter');
var firebaseExectutable = whichSync('firebase');

shell #

Allows to run script from Mac/Windows/Linux in a portable way. Empty lines are added for lisibility

import 'package:process_run/shell.dart';

Run a simple script:

var shell = Shell();

await shell.run('''

# Display some text
echo Hello

# Display dart version
dart --version

# Display pub version
pub --version

''');

More information on shell here

Additional features #

Addtional features and information are available here

Changelog #

0.10.1 #

  • add userPaths and userEnvironment access and allow overriding for finding executable and passing env variable to calleed

0.10.0 #

  • feat: add Shell class and features
  • try to resolve single command everywhere

0.9.0 #

  • fix: which now returns the full path on linux

0.8.0 #

  • Deprecate old commands helper dartCmd, pubCmd... to use constructors instead (DartCmd, PubCmd...)
  • Add webdev and pbr command

0.7.0 #

  • add flutter command support
  • add Windows support
  • add which utility

0.6.0 #

  • dart2 support

0.5.6 #

  • supports implicit-casts: false

0.5.5 #

  • when using io.stdout and io.stderr, flush them when running a command

0.5.4 #

  • Fix handling of stdin

0.5.2 #

  • fix dart2js to have a libraryRoot argument
  • add dartdevc

0.5.1 #

  • fix devRun

0.5.0 #

  • deprecated connectStdout and connectStrerr in ProcessCmd
  • add stdin, stdout, verbose and commandVerbose parameter for run

0.4.0 #

  • add stdin and deprecated buggy connectStdin

0.3.3 #

  • add argumentToString to handle basic quote or double quote

0.3.2 #

  • fix dartdoc to add --packages argument along with the snapshot

0.3.0 #

  • Add runCmd (cmd_run library)

0.2.0 #

  • Add ProcessCmd

0.1.0 #

  • Initial version, run and dartbin utilities

example/example.dart

import 'dart:async';

import 'package:process_run/shell.dart';

Future main() async {
  // This works on Windows/Linux/Mac

  var shell = Shell();

  await shell.run('''

# Display some text
echo Hello

# Display dart version
dart --version

# Display pub version
pub --version

  ''');

  shell = shell.pushd('example');

  await shell.run('''

# Listing directory in the example folder
dir

  ''');
  shell = shell.popd();
}

Use this package as a library

1. Depend on it

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


dependencies:
  process_run: ^0.10.1

2. Install it

You can install packages from the command line:

with pub:


$ pub get

with Flutter:


$ flutter pub get

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

3. Import it

Now in your Dart code, you can use:


import 'package:process_run/process_run.dart';
  
Version Uploaded Documentation Archive
0.10.1 May 19, 2019 Go to the documentation of process_run 0.10.1 Download process_run 0.10.1 archive
0.10.0+1 Feb 25, 2019 Go to the documentation of process_run 0.10.0+1 Download process_run 0.10.0+1 archive
0.10.0 Feb 24, 2019 Go to the documentation of process_run 0.10.0 Download process_run 0.10.0 archive
0.9.0 Feb 6, 2019 Go to the documentation of process_run 0.9.0 Download process_run 0.9.0 archive
0.8.1 Jan 16, 2019 Go to the documentation of process_run 0.8.1 Download process_run 0.8.1 archive
0.8.0+1 Oct 10, 2018 Go to the documentation of process_run 0.8.0+1 Download process_run 0.8.0+1 archive
0.8.0 Oct 10, 2018 Go to the documentation of process_run 0.8.0 Download process_run 0.8.0 archive
0.7.0+2 Oct 8, 2018 Go to the documentation of process_run 0.7.0+2 Download process_run 0.7.0+2 archive
0.7.0+1 Oct 8, 2018 Go to the documentation of process_run 0.7.0+1 Download process_run 0.7.0+1 archive
0.7.0 Sep 18, 2018 Go to the documentation of process_run 0.7.0 Download process_run 0.7.0 archive

All 28 versions...

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

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

  • Dart: 2.3.1
  • pana: 0.12.16

Platforms

Detected platforms: Flutter, other

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

Dependencies

Package Constraint Resolved Available
Direct dependencies
Dart SDK >=2.1.0-dev <3.0.0
collection >=1.14.10 <3.0.0 1.14.11
io >=0.3.0 <2.0.0 0.3.3
meta >=1.1.0 <3.0.0 1.1.7
path >=1.6.1 <3.0.0 1.6.2
yaml >=2.0.0 <4.0.0 2.1.15
Transitive dependencies
charcode 1.1.2
source_span 1.5.5
string_scanner 1.0.4
term_glyph 1.1.0
Dev dependencies
args any
async any
build_runner >=0.9.0
build_test >=0.10.2
pedantic >=1.4.0
pub_semver any
test >=1.2.0