Giter Club home page Giter Club logo

process_run.dart's Introduction

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

process_run.dart's People

Contributors

alextekartik avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.