Skip to content

Commit

Permalink
Bash command runner is in progress.
Browse files Browse the repository at this point in the history
  • Loading branch information
victor-shelepen committed Mar 15, 2020
1 parent d78f9b0 commit e1730a4
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 2 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
[![Build Status](https://travis-ci.org/vlikin/console.svg?branch=master)](https://travis-ci.org/vlikin/console)
[![Coverage Status](https://coveralls.io/repos/github/vlikin/console/badge.svg?branch=master)](https://coveralls.io/github/vlikin/console?branch=master)

[![NPM](https://nodei.co/npm/console.png?downloads=true&downloadRank=true)](https://nodei.co/npm/console/)
[![NPM](https://nodei.co/npm-dl/console.png?months=9&height=3)](https://nodei.co/npm/console/)
[![NPM](https://nodei.co/npm/console-command-manager.png?downloads=true&downloadRank=true)](https://nodei.co/npm/console-command-manager/)
[![NPM](https://nodei.co/npm-dl/console-command-manager.png?months=9&height=3)](https://nodei.co/npm/console-command-manager/)

It helps run to custom commands from bash, is able to control your service from console like the think client does.
Main parts of the project:
Expand Down
21 changes: 21 additions & 0 deletions src/cli.js
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,27 @@ function runCLI(greetings, _commands, injection=null, readLine=null) {
return cli
}

function runCommand(_commands, injection=null, args) {
const _injection = {
console
}
const allCommands = [
...commands,
..._commands
]
if (injection) {
injection = {
..._injection,
...injection
}
} else {
injection = _injection
}
const manager = new Manager(allCommands, injection)
const tokens = args
const command = tokensToCommand(tokens)
}

module.exports = {
commands,
runCLI,
Expand Down

0 comments on commit e1730a4

Please sign in to comment.