Skip to content

Commit

Permalink
REF: (Breaking change) blessed and blessed-contrib modules are optional
Browse files Browse the repository at this point in the history
  • Loading branch information
royriojas committed Feb 5, 2017
1 parent 2c26cf8 commit 2c292e0
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 6 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ npm i -g shell-executor
Usage: shell-exec [options] cmd1, cmd2, ... cmdn
Options:
-d, --dashboard Show the processes in a nice dashboard if space allows it. No more than 9 commands are allowed in this mode
-d, --dashboard Show the processes in a nice dashboard if space allows it. No more than 9 commands are allowed in this mode. Requires the install of blessed@0.1.81 and blessed-contrib@4.7.5
-b, --bail Stop execution as soon as one of the task exit with an exit code different than 0 or an error happened
-o, --sortOutput Sort the stdout and stderr output from the commands
-h, --help Show this help
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,8 @@
"babel-preset-es2015": "6.18.0",
"babel-preset-react": "6.16.0",
"babel-preset-stage-0": "6.16.0",
"blessed": "0.1.81",
"blessed-contrib": "4.7.5",
"changelogx": "2.0.1",
"eslint": "3.13.1",
"eslint-config-airbnb": "14.0.0",
Expand All @@ -70,8 +72,6 @@
"watch-spawn": "2.0.0"
},
"dependencies": {
"blessed": "0.1.81",
"blessed-contrib": "4.7.5",
"clix": "2.2.1",
"dispatchy": "1.0.3",
"es6-promise": "4.0.5",
Expand Down
24 changes: 22 additions & 2 deletions source/src/main.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
import { getGridAndScreen, setProcessLogToGrid } from './grid';

const exec = require('child_process').exec;
const path = require('path');
const nodeProcess = require('./process');
Expand Down Expand Up @@ -35,6 +33,28 @@ const printFailed = entries =>

module.exports = {
_executeCommandsInDashboard(program, cmds) {
let gridModule;

try {
// eslint-disable-next-line
gridModule = require('./grid');
} catch (err) {
program.error(`
Cannot load the grid module. ared blessed and blessed-contrib installed?
try doing:
npm i blessed@0.1.81 blessed-contrib@4.7.5
or with yarn
yarn add blessed@0.1.81 blessed-contrib@4.7.5
`);
}


const { getGridAndScreen, setProcessLogToGrid } = gridModule;

const { grid, screen } = getGridAndScreen();
const count = cmds.length;
Expand Down
2 changes: 1 addition & 1 deletion source/src/options.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ module.exports = {
option: 'dashboard',
alias: 'd',
type: 'Boolean',
description: 'Show the processes in a nice dashboard if space allows it',
description: 'Show the processes in a nice dashboard if space allows it. No more than 9 commands are allowed in this mode. Requires the install of blessed@0.1.81 and blessed-contrib@4.7.5',
},
{
option: 'bail',
Expand Down

0 comments on commit 2c292e0

Please sign in to comment.