Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/brickpop/runner-cli
A universal task runner wrapper. Supporting NPM scripts, Gulp, Makefiles and shell scripts
https://github.com/brickpop/runner-cli
Last synced: 11 days ago
JSON representation
A universal task runner wrapper. Supporting NPM scripts, Gulp, Makefiles and shell scripts
- Host: GitHub
- URL: https://github.com/brickpop/runner-cli
- Owner: brickpop
- Created: 2018-07-20T11:00:20.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2018-11-18T15:40:25.000Z (about 6 years ago)
- Last Synced: 2024-12-10T04:23:44.389Z (18 days ago)
- Language: JavaScript
- Homepage: https://medium.com/ledfusion/a-universal-task-runner-to-run-them-all-d93f1a1bf8b1
- Size: 57.6 KB
- Stars: 22
- Watchers: 3
- Forks: 1
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# runner-cli
A universal task runner, with support for NPM scripts, Gulp, Makefiles and shell scriptsThe 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 `bash 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 twonpm 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 mainThis is action one
This is action two
This is the main action
```If the project has a `taskfile`:
```
$ run main
bash taskfile mainThis is the main action
Sequential actions:
> This is action one
> This is action two (parameter $1 = testing)
Actions one and two completedConcurrent actions:
> This is action two (no parameter)
> This is action one
Actions one and two completed concurrentlyTask 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 runScripts 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
makeAvailable 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
bash taskfiletaskfile
Available tasks:
1 default
2 main
3 one
4 two
Task completed in 0m0.004s
```### Why a meta task runner
Read the [motivational article on Medium.com](https://medium.com/jordi-moraleda/a-universal-task-runner-to-run-them-all-d93f1a1bf8b1)### Roadmap:
- [x] Run tasks from `package.json`
- [x] Run tasks from `gulpfile.js`
- [x] Run tasks from `makefile`
- [x] Run tasks from [taskfile's](https://hackernoon.com/introducing-the-taskfile-5ddfe7ed83bd) (shell scripts exposing functions)
- [x] Display the available tasks
- [x] Detect and prompt for installation if a tool is missing
- [x] Install local Gulp if missing
- [x] Generate templates for the supported formats