Giter Site home page Giter Site logo

esteban-rocha / runner-cli Goto Github PK

View Code? Open in Web Editor NEW

This project forked from brickpop/runner-cli

0.0 1.0 0.0 72 KB

A universal task runner, with support for NPM scripts, Gulp, Makefiles and shell scripts

JavaScript 77.80% Makefile 10.64% Shell 11.57%

runner-cli's Introduction

runner-cli

A universal task runner, with support for NPM scripts, Gulp, Makefiles and shell scripts

The tool is currently a work in progress.

Usage

Install it on your system:

npm i -g runner-cli

To display the available actions:

run

The command above will attempt to locate package.json, gulpfile.js, makefile and taskfile and display the available commands.

To run a task:

run action

The command above will attempt to run npm run action, gulp action, make action and sh taskfile action.

Invocation examples

Let's assume that we have a main action that depends on actions one and two (check the examples folder).

If the project has a gulpfile.js:

$ run main
gulp main

[18:13:23] Using gulpfile ~/git/runner-cli/example/gulpjs/gulpfile.js
[18:13:23] Starting 'one'...
This is task 1
[18:13:23] Finished 'one' after 152 μs
[18:13:23] Starting 'two'...
This is task 2
[18:13:23] Finished 'two' after 90 μs
[18:13:23] Starting 'main'...
This is the main task
[18:13:23] Finished 'main' after 67 μs

If the project has a package.json:

$ run main
npm run main


> [email protected] main /Users/jordi/git/runner-cli/example/npm
> run one && run two

npm run one


> [email protected] one /Users/jordi/git/runner-cli/example/npm
> echo 'This is action 1'

This is action 1
npm run two


> [email protected] two /Users/jordi/git/runner-cli/example/npm
> echo 'This is action 2'

This is action 2

If the project has a makefile:

$ run main
make main

This is action one
This is action two
This is the main action

If the project has a taskfile:

$ run main
sh taskfile main

This is the main action

Sequential actions:
> This is action one
> This is action two (parameter $1 = testing)
Actions one and two completed

Concurrent actions:
> This is action two (no parameter)
> This is action one
Actions one and two completed concurrently

Task completed in 0m0.002s

Display available commands

In the same scenario as before, we just execute run:

If the project has a gulpfile.js:

$ run
gulp --tasks

[18:01:14] Using gulpfile ~/git/runner-cli/example/gulpjs/gulpfile.js
[18:01:14] Tasks for ~/git/runner-cli/example/gulpjs/gulpfile.js
[18:01:14] ├── one
[18:01:14] ├── two
[18:01:14] └─┬ main
[18:01:14]   ├── one
[18:01:14]   └── two

If the project has a package.json:

$ run
npm run

Scripts available in runner-cli-npm-example via `npm run-script`:
  one
    echo 'This is action 1'
  two
    echo 'This is action 2'
  main
    run one && run two

If the project has a makefile:

$ run
make

Available actions:

  $ make         Runs 'make info' by default
  $ make info    Shows this text

  $ make one     Action one
  $ make two     Action two
  $ make main    The main action

If the project has a taskfile:

$ run
sh taskfile

taskfile <task> <args>

Available tasks:
     1	default
     2	main
     3	one
     4	two
Task completed in 0m0.004s

Why a pseudo task runner

An article will be published soon. Stay tuned!

Roadmap:

  • Run tasks from package.json
  • Run tasks from gulpfile.js
  • Run tasks from makefile
  • Run tasks from taskfile's (shell scripts exposing functions)
  • Display the available tasks
  • Detect and prompt for installation if a tool is missing
  • Install local Gulp if missing
  • Generate templates for the supported formats

runner-cli's People

Contributors

brickpop avatar

Watchers

 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.